A TeX file may contain text, symbols, or arithmetic expressions. These are used for typesetting the documents and you can typeset TeX input to PDF, XPS, and several other supported formats. In this article, you will be learning how to convert TeX to PDF or XPS files programmatically using C#. The following sections explain the topic in detail:
- TeX to PDF or XPS Converter – C# API Installation
- Convert TeX (LaTeX) to PDF Programmatically using C#
- TeX ZIP directory to PDF ZIP Directory Conversion using C#
- Convert LaTeX (TeX) to XPS File Programmatically using C#
- Get Free API License
TeX to PDF or XPS Converter – C# API Installation
Aspose.TeX for .NET API has been designed for typesetting TeX files to different file formats like PDF, XPS, or images. You can quickly configure the API by downloading the DLL file from the Downloads section, or you can install it from NuGet with the following installation command:
PM> Install-Package Aspose.TeX
Convert TeX (LaTeX) to PDF Programmatically using C#
You can convert TeX to PDF file with the steps below:
- Create typesetting options for default ObjectTeX format.
- Specify console or memory stream as an output terminal.
- Set options for rendering into PDF format.
- Call TexJob class constructor and save output PDF with PdfDevice class object.
The following code snippet explains how to convert TeX to PDF file programmatically using C#:
Convert TeX ZIP directory to PDF ZIP Directory using C#
You may need to convert multiple TeX files to PDF at a time. In such cases, you may convert TeX file in a ZIP archive to PDF document in zipped form. You need to follow the steps below:
- Open streams on ZIP archives as the input and output working directory.
- Create typesetting options using the TeXOptions class object.
- Create and specify saving options with PdfSaveOptions.
- Run typesetting with TexJob class constructor.
The code below elaborates how to convert TeX ZIP archive to PDF ZIP archive programmatically using C#:
Convert TeX (LaTeX) to XPS File Programmatically using C#
You can convert TeX to XPS file with the following steps:
- Create typesetting options on ObjectTeX engine extension.
- Specify a file system working directory for input and output.
- Convert TeX to XPS by running Typesetting with XpsDevice.
The following code shows how to convert TeX file to XPS programmatically using C#:
Get Free API License
You can evaluate the API with full access by requesting a Free Temporary License.
In this article, you have explored how to convert TeX files to PDF or XPS files programmatically using C#. Moreover, you have also learned how to convert a TeX file in a ZIP archive and create an output ZIP directory. You can have a look at several other features by visiting the API Documentation. Please feel free to contact us at the Free Support Forum in case of any concerns.