No description
3e05384d05
Bumps htmlcleaner from 2.24 to 2.26. --- updated-dependencies: - dependency-name: net.sourceforge.htmlcleaner:htmlcleaner dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
---|---|---|
.github | ||
src | ||
.gitattribute | ||
.gitignore | ||
LICENSE | ||
pom.xml | ||
README.md |
epub-creator
Java EPUB3 creator API
Create EPUB3 standard ebooks.
Features
- Build valid EPUB3 (Validator)
- Add files or text as content
- Set TOC inclusion
- Set spine inclusion
- Add text as content/pages
Build instructions
You will need
- Java 8+
- 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);
}