eBook files are electronic files that can be opened on digital devices known as eReaders. An eReader can be any device such as a computer, a tablet, or a smartphone. The most popular eBook file format is the XML-based ePub. An eBook can contain different types of content such as text, images, and video. Common eBook file extensions and their file formats include EPUB (electronic publication), FB2 (FictionBook 2.0), and Mobi (MobiPocket eBook File).
With GroupDocs.Conversion you can easily convert your eBook document into another file format. For example, an eBook to PDF conversion code snippet looks like this:
importcom.groupdocs.conversion.Converter;importcom.groupdocs.conversion.options.convert.PdfConvertOptions;...// Load the source eBook file
Converterconverter=newConverter("sample.mobi");// Set the convert options for PDF format
PdfConvertOptionsoptions=newPdfConvertOptions();// Convert to PDF format
converter.convert("converted.pdf",options);
Put it simply - you just load an eBook file into the Converter class, select the desired output format and GroupDocs.Conversion does all the rest.
Note
Refer to the API reference for more conversion options and customizations.
Convert to eBook formats
On the other hand, converting your files to eBook format is also quite simple and natural. Minimally, all you need is to specify the desired output format in the setFormat method of the EBookConvertOptions class instance.
The following code snippet shows how to convert a PDF document to eBook format in Java using GroupDocs.Conversion.
importcom.groupdocs.conversion.Converter;importcom.groupdocs.conversion.options.convert.EBookConvertOptions;...// Load the source PDF file
Converterconverter=newConverter("sample.pdf");// Set the convert options for eBook format
EBookConvertOptionsoptions=newEBookConvertOptions();options.setFormat(EBookFileType.Epub);// Convert to eBook format
converter.convert("converted.epub",options);
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.