Convert EPUB to PDF using Cloud SDK – Aspose.HTML

Aspose.HTML Cloud provides the simplest API to convert EPUB to PDF with high quality, easy and fast. The EPUB format has gained popularity as an XML-based e-book format and designed to adapt the content’s presentation to the reader device. It is implemented as an archive file consisting of XHTML files carrying the content, images and other supporting files. PDF is basically a static document that can contain text, images, form-fields, media, digital signatures, hyperlinks, etc. One of the PDF benefits is your paper will be presented exactly how you designed it out, and it is ideal for sending documents that are intended to be printed out.

This article explains in a set of Aspose.HTML Cloud SDK examples how to convert EPUB to PDF. SDKs are available in PHP, C++, Python, C#, Ruby, Java, Android, Swift, and Node.js. We will consider various scenarios of EPUB to PDF conversion:

  • Converting a local EPUB file to PDF and saving the result in your local file system. In this scenario, we will explore both conversions with default conversion parameters and with explicitly specified parameters.
  • Converting EPUB to PDF in cloud storage with default conversion parameters.

Examples of EPUB to PDF Conversion

A widespread use case for Aspose.HTML Cloud functions is file processing and converting. Cloud SDK allows you to fetch an EPUB document from a storage location by its name or from a local file on your drive, convert it to a specified format and save it to the storage or the local drive. The following code examples demonstrate how to convert EPUB to PDF for different cases using available SDKs and REST API.

Example 1. Convert EPUB to PDF

Consider converting an EPUB document initially located on a local file system to PDF format. The EPUB to PDF conversion occurs with the default conversion options. The resultant file is then saved back to the local file system.

EPUB to PDF conversion occurs with the default conversion options: the resulting PDF document’s width and height correspond to A4, and all margins have zero value.

Example 2. Convert EPUB to PDF with explicitly specified options

The example below demonstrates how to convert an EPUB file from a local file system to PDF with explicitly specified options and save the result back to the file system.

More details about available conversion parameters for EPUB files are in the SDK Conversion Options section.

Example 3 Convert EPUB to PDF inside cloud storage

Aspose.HTML Cloud allows you to get an EPUB file from your cloud storage and save conversion result back to cloud storage.

See Also