No description
Find a file
2019-11-06 01:07:25 +02:00
src Update media type method 2016-05-04 09:36:36 +02:00
.gitattribute Create .gitattribute 2017-03-10 13:41:17 +02:00
.gitignore Adding the api 2015-12-03 15:23:58 +02:00
.travis.yml Add coverty 2016-03-29 16:18:28 +02:00
LICENSE Create LICENSE 2016-03-30 09:08:29 +02:00
pom.xml [maven-release-plugin] prepare for next development iteration 2019-11-06 01:07:25 +02:00
pom.xml.releaseBackup Releasing 1.0.1 2019-11-06 01:05:23 +02:00
README.md Update README.md 2016-04-12 13:07:36 +02:00
release.properties Releasing 1.0.1 2019-11-06 01:05:23 +02:00

epub-creator

epub-creator version WTFPL license Build Status Coverity Scan Build Status

Java EPUB3 creator API

Create EPUB3 standard ebooks.

Features

  1. Build valid EPUB3 (Validator)
  2. Add files or text as content
  3. Set TOC inclusion
  4. Set spine inclusion
  5. Add text as content/pages

Build instructions

You will need

  1. Java 7+
  2. Maven 3+
mvn clean install

Code example

try (FileOutputStream file = new FileOutputStream(new File("test.epub"))) {

            EpubBook book = new EpubBook("en", "Samuel .-__Id1", "Test Book", "Samuel Holtzkampf");
            book.addContent(this.getClass().getResourceAsStream("/epub30-overview.xhtml"),
                    "application/xhtml+xml", "xhtml/epub30-overview.xhtml", true, true).setId("Overview");
            book.addContent(this.getClass().getResourceAsStream("/idpflogo_web_125.jpg"),
                    "image/jpeg", "img/idpflogo_web_125.jpg", false, false);
            book.addContent(this.getClass().getResourceAsStream("/epub-spec.css"),
                    "text/css", "css/epub-spec.css", false, false);
            book.addTextContent("TestHtml", "xhtml/test2.xhtml", "Test one two four!!!!!\nTesting two").setToc(true);
            book.addTextContent("TestHtml", "xhtml/test.xhtml", "Test one two three\nTesting two").setToc(true);
            book.addCoverImage(IOUtils.toByteArray(this.getClass().getResourceAsStream("/P1010832.jpg")),
                    "image/jpeg", "images/P1010832.jpg");

            book.writeToStream(file);
        }