Convert EPUB to XPS in Java

EPUB to XPS Programmatically Java

EPUB file is in Open eBook file format which is usually used to publish books. In particular use cases, you may need to convert an EPUB file to XPS file format. In this article, you will learn how to convert EPUB to XPS files programmatically in Java.

EPUB to XPS Converter – Java API Installation

Aspose.HTML for Java API supports working with EPUB, XPS, and many other file formats. You can quickly configure the API by downloading its JAR file from the New Releases section or installing it from Aspose Repository with the following configurations:

Repository

 <repositories>
     <repository>
         <id>snapshots</id>
         <name>repo</name>
         <url>http://repository.aspose.com/repo/</url>
     </repository>
</repositories>

Dependency

 <dependencies>
    <dependency>
        <groupId>com.aspose</groupId>
        <artifactId>aspose-html</artifactId>
        <version>21.12</version>
        <classifier>jdk16</classifier>
    </dependency>
</dependencies>

Convert EPUB to XPS File Programmatically in Java

You need to follow the steps below for converting an EPUB file to an XPS document programmatically in Java:

  1. Firstly, load the input EPUB file.
  2. Create an object of XpsSaveOptions class.
  3. Set page dimensions in inches, centimeters, etc. as required.
  4. Finally, convert EPUB to XPS file.

The code snippet below explains how to convert an EPUB file to an XPS file in Java:

Get Free Evaluation License

You can evaluate all the features of the API in their full capacity by requesting a free temporary license.

Explore Other Features

You may visit the documentation section to explore several other features supported by the API.

Online Demo

Please try the EPUB to XPS Converter web app developed using the above API.

Conclusion

In this article, you have learned how to convert an EPUB file to XPS format. You can control different properties of the output file like the page height, width, resolutions, etc. Moreover, you can find many other features of the API by visiting the documentation. Furthermore, please feel free to reach out to us at the forum in case of any queries.

See Also

Convert Markdown to HTML or HTML to MD File in Java