Aspose.TeX for .NET is a go-to mechanism for creating and processing LaTeX/TeX files in .NET applications. In addition, it also offers rich conversions to other popular file formats such as PDF, PNG, and more. This C# TeX API is developer-friendly and you can easily integrate it with third-party libraries. Moreover, there are features exposed by this .NET library to handle TeX/LaTeX documents programmatically. So, in this blog post, we will explore this C# library for LaTeX to XPS conversion with a real-time code example. Let’s start with the installation first.
- C# TeX API Installation
- C# Library for LaTeX to XPS – Code Example
- LaTeX to XPS Converter – Online Tool
C# TeX API Installation#
The following single command will install Aspose.TeX for .NET in your .NET project. Run into the NuGet Package Manager.
Install-Package Aspose.TeX
Moreover, you can install it by downloading the DLL file.
C# Library for LaTeX to XPS – Code Example#
Now, we are all set to write a code snippet to implement the LaTeX to XPS conversion programmatically.
The steps are:
- Define the working directory.
- Create conversion options for Object LaTeX format upon Object TeX engine by calling the ConsoleAppOptions method.
- Specify a file system working directory for the output.
- Initialize an object of the XpsSaveOptions class for saving in XPS format.
- Create an instance of the XpsDevice class and initialize it with xpsStream.
- Run LaTeX to XPS conversion by invoking the TeXJob constructor.
You can see the output in the image:
LaTeX to XPS Converter – Online Tool#
This is an online tool powered by Aspose.TeX for .NET. The best thing about this tool is that it is free and provides efficient TeX/LaTeX to XPS conversion. Moreover, it saves the resultant file on your disk. Further, there is a drag and drop interface along wth other options to upload the source LaTeX/TeX files.
Get a Free License#
You can get a free temporary license to try this C# TeX API beyond evaluation limitations.
Summing up#
This brings us to the end of this blog post. We have gone through how to use this C# library for LaTeX to XPS conversion programmatically. Moreover, we covered the implementation by writing a code sample. However, this documentation explains the uncovered details. So, you can jump to GitHub repo and API references if you want to start building a LaTeX to XPS converter for your application.
Feel Free to Reach Out#
You can let us know about your questions or queries on our forum.
See Also#
- BMP Image Generation From TeX in C# – TeX to Image
- Convert LaTex to SVG using C# LaTex Library