There are many ways to create a pdf for bookbinding; however, I didn't find one that really suited my needs so I created this enhanced one. I want to create a unified software system for easy editing and exportation of large EPUB books and remove many manual steps that are required using other methods.
Benifits to traditional EPUB conversion for binding:
- Automates Injestion and exportation
- allows for custom css and reusable code for similar projects
- outputs to EPUB and PDF for versitile distribution
To get a local copy up and running follow these simple example steps.
Nodejs is required to run the build tools and the binder pdfserver
clone repositories Binder & Binder-PdfServer. The relative location of both projects is not important.
for production building and other development flags see Angular cli reference pages
Binder-PdfServer is required to run for noraml program operation, after cloning the Binder-PdfServer follow the same steps listed below in that directory. default port: 3000
- Update npm to latest version
npm i -g npm@latest
- Install Node Modules
npm install
- Run Development server (default port 4200)
npm run start
Ebooks can be found on the project guetenberg website. They are all public domain and can be modified and distributed in any way you see fit.
Steps for creating a pdf:
- Download ebook from project guetenberg. We highly recomend little women; it's a great read.
- open web application most likely at http://localhost:4200.
- click
new project
. - select
Choose File
and select the file for the downloaded ebook. - Edit files.
- Press
export
in the top left of the editor screen. - Select
render to pdf
to download a pdf for binding or Selectdownload epub zip
to save your changes for editing later
Files are edited via the Editor page. Only text files are avalible for editing and viewing.
Note: Images will not be shown and the EPUB will need to be downloaded and converted to a zip file to see/edit images. All images will be coppied over to the downloadable epub and will be rendered when included in the finished PDF.
Epubs use the XHTML5 syntax and accept all valid HTML. These files makeup the displayed content of the EPUB file.
while the name of the file is unlikely to vary, the file may have a different name or file path. To find the file that contains the manifest and metadata open the META-INF/container.xml
file and find this line:
<rootfile full-path="{YOUR FILE WILL BE LISTED HERE}" media-type="application/oebps-package+xml"/>
The metadata will be found at the top of the content file. At this time the information will not be embedded into the pdf but will continue to provide information for the ebook and it is recomended when you change the files to add yourself as a contributor under the <dc:creator>
tag with the syntax:
<dc:contributor opf:role="{YOUR ROLE HERE}" opf:file-as="{YOUR NAME}">{YOUR NAME}</dc:contributor>
The <manifest>
contains All the files that are included in the EPUB file and their ID, Media Type, and url/href. The files included are not gaurented to be in the correct order and for ordering you should look to the <spine>
.
The <spine>
contains an ordered list of <itemref>
's detailing the contents of the EPUB in the order it should be displayed. Especially for books, this is not the same as the list of chapters or sections. however the table of contents is specified in the spine by the attribute <spine toc="">
.
The <Itemref>
's inside the spine reference the <item>
tags in the manifest. They are in the format:
<itemref idref="{ITEM ID}" linear="yes"/>
<item href="{PATH TO FILE}" id="{ITEM ID}" media-type="application/xhtml+xml"/>
The BinderCss.html
file is not standard to the epub file format. It is automatically injected into the ingested epub file. It does not/will not be added to the manifest. It contains the template code for setting helpful page css special attributes for printing . It needs to be uncommented. This serves as a helper file which will not change the EPUB for regular consumption and serves only to specify the configuration for exporting to pdf for binding. For aditional information on available css see the @page
CSS at-rule.
The file contains sample css for size and page numbers shown below:
<style>
@page{
/* Page Size & orientation */
/* size: A4 landscape; */
/* page numbers */
/* @bottom-left {
content: counter(page) ' of ' counter(pages);
} */
}
</style>
For all code examples, user fields will be denoted by {ALL CAPS TEXT}
.
As an example for the user feild value Matthew for the code block <test input="{HELLO}">
would have a resulting code block of
<test input="Matthew">
NOT <test input="{Matthew}">
This software system while functional is not the most user friendly. Any contributions are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request.
Distributed under the MIT License. See LICENSE
for more information.
We request that all EPUB files you use in this program you have the rights to modify and that you follow all aplicable laws in the use of the software and with any files created by the software.
Matthew Hyland - [email protected]