EPUB Converter – Convert EPUB in Java
EPUB is an open-source e-book file format that is the standard digital publishing format. EPUB file standards are maintained by the International Digital Publishing Forum (IDPF). EPUB is supported by many e-readers and devices, including smartphones, tablets, and computers, making it a widely accepted format. An EPUB file is a collection of files, including HTML, CSS, and multimedia content, packaged together in a ZIP archive.
EPUB conversions are often required to take advantage of other formats that can provide greater flexibility and make it easier to share, print, store, and use digital content. Aspose.HTML for Java provides a wide range of EPUB conversions to popular formats, such as PDF, XPS, DOCX, JPG, PNG, BMP, TIFF, and GIF.
This section provides information on the list of supported EPUB conversions and how to perform them using convertEPUB()
methods of the
Converter class. It can be different scenarios, but any EPUB conversion can be made with a few required steps:
- Load an existing EPUB file.
- Create a SaveOptions object. You may customize the rendering process to get the desired result.
- Use one of the
convertEPUB()
methods and pass the required parameters to it.
Let’s consider the following code snippet that shows how to convert EPUB to PDF using our Java library:
1// Open an existing EPUB file for reading.
2java.io.FileInputStream fileInputStream = new java.io.FileInputStream($i("input.epub"));
3
4// Create an instance of the PdfSaveOptions class
5PdfSaveOptions options = new PdfSaveOptions();
6
7// Call the ConvertEPUB() method to convert EPUB to PDF
8Converter.convertEPUB(fileInputStream, options, $o("output-epub-to-pdf.pdf"));
Note: You need to specify the path to the source and output file in your local file system (sourcePath
and savePath
).
You can download the complete examples and data files from GitHub.
Aspose.HTML provides a free online EPUB Converter that enables you to convert EPUB files to various popular formats. This tool can easily convert EPUB to PDF, XPS, DOCX, JPG, PNG, BMP, TIFF, and GIF. The conversion process is simple and fast. All you need to do is select the file and choose the desired output format. The best part is that it’s completely free!