Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Extract Images from eBooks in Java using Parser API - (PDF, EPUB, FB2, CHM)
// Parse eBooks to Extract Images from PDF, EPUB, FB2, CHM files in Java and save to disk.
Parser parser = new Parser("ebook.epub");
// Extract images from eBook and save in JPEG format.
Iterable<PageImageArea> images = parser.getImages();
ImageOptions options = new ImageOptions(ImageFormat.Jpeg);
int imageNumber = 0;
// Iterate over extracted images
for (PageImageArea image : images) {"%d.jpeg", imageNumber)), options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment