Skip to content

mph6083/Binder

Repository files navigation


Logo

Binder

An open source EPUB3 editor and exporter for use in bookbinding


Product Name Screen Shot

About The Project

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

(back to top)

Built With

(back to top)

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

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.

Installation

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

  1. Update npm to latest version
npm i -g npm@latest
  1. Install Node Modules
npm install
  1. Run Development server (default port 4200)
npm run start

(back to top)

Usage

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:

  1. Download ebook from project guetenberg. We highly recomend little women; it's a great read.
  2. open web application most likely at http://localhost:4200.
  3. click new project.
  4. select Choose File and select the file for the downloaded ebook.
  5. Edit files.
  6. Press export in the top left of the editor screen.
  7. Select render to pdf to download a pdf for binding or Select download epub zip to save your changes for editing later

(back to top)

Editing Files

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.

*.html | *.xhtml | *.htm

Epubs use the XHTML5 syntax and accept all valid HTML. These files makeup the displayed content of the EPUB file.

OEBPS/content.opf

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"/>

Metadata

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>

manifest

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>.

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"/>

BinderCss.html

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>

Note on coding examples

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}">

Contributing

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".

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request.

(back to top)

License

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.

Contact

Matthew Hyland - [email protected]

(back to top)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published