Convert Latex to XPS in Java

LaTeX is designed to provide descriptive markup language and is widely used in academia. It is popular for creating scientific or research documents. In some scenarios, you might need to convert LaTeX to XPS document in your applications. In accordance with such use cases, this article explains how to convert a TeX file to an XPS document programmatically in Java.

TeX to XPS Document Converter – Java API Configuration

Aspose.TeX for Java API can be used to typeset LaTeX and TeX files in your Java applications. It supports exporting the TeX files to different file formats like SVG, XPS, PNG, etc. You may download the JAR file from the New Releases page, or paste the following Maven configuration in the pom.xml file of your project to configure it from the repository:

<repository>
    <id>AsposeJavaAPI</id>
    <name>Aspose Java API</name>
    <url>https://repository.aspose.com/repo/</url>
</repository> 
<dependency>
    <groupId>com.aspose</groupId>
    <artifactId>aspose-tex</artifactId>
    <version>22.8</version>
</dependency>

How to Convert LaTeX TeX to XPS in Java

The steps below explains how to convert a LaTeX file to an XPS document in Java:

  1. Initialize an instance for LaTeX conversion options.
  2. Set the directory to manipulate files.
  3. Create an object of XPSSaveOptions class.
  4. Run the conversion to export LaTeX to XPS format.

Convert LaTeX to XPS Document Programmatically in Java

The following steps demonstrate how to convert a LaTeX file to an XPS document programmatically in Java:

  1. Initialize an instance for LaTeX conversion options with TeXOptions class.
  2. Set the directory to manipulate files.
  3. Initialize an instance of XPSSaveOptions class.
  4. Run the LaTeX to XPS file conversion with TexJob class.

The code snippet below elaborates how to convert LaTeX to XPS file programmatically in Java:

Get Free Evaluation License

Interested to try the API features to their full capacity? You may request a free temporary license in order to avoid the evaluation limitations.

Conclusion

In this article, you have explored how to convert a LaTeX file to an XPS document programmatically in Java. Furthermore, you may like to visit the documentation section to check out the other features supported by the API. In case you have any queries please write to us at forum.

See Also