Powerful .NET Typesetting API to Convert TeX and LaTeX to PDF

Effortlessly integrate typesetting functionality into your apps to typeset TeX and LaTeX files and accurately generate PDFs, raster images, and vectors.

Download Free TrialView All APIs

Automate TeX Document Processing Workflows in .NET

Aspose.TeX for .NET provides typesetting capabilities to developers looking to process TeX and LaTeX files in their .NET solutions. Using the API, developers can programmatically generate PDF documents from TeX and LaTeX files and convert these files to XPS documents, JPEG, PNG, BMP, and TIFF raster image formats, as well as SVG vectors. Our API helps end users typeset TeX files and make custom TeX formats.

The .NET typesetting API enables developers to load TeX files from various sources, typeset them, convert them to multiple file formats, export them to ZIP archives, generate customized TeX formats, create mathematical equations in LaTeX, and do more. Aspose.TeX for .NET is a powerful library with easy-to-use features that allow users to automate TeX and LaTeX document processing solutions and conveniently optimize their existing workflows.

Getting Started

Before getting started and installing Aspose.TeX for .NET, please visit the System Requirements page. This page provides the recommended framework, OS, and development environment information. Please ensure compliance with the settings outlined on this page to enjoy a smooth API usage experience.

Aspose.TeX for .NET Installation

Please download the MSI installer or the DLLs of the .NET TeX file typesetting library from the downloads section to set up the library. You can also install the library using the NuGet package. The command for the Visual Studio package manager console is provided below:

PM > Install-Package Aspose.TeX

Learn to Convert TeX to PDF and LaTeX to JPG in .NET Solutions

Aspose.TeX for .NET supports converting TeX files to multiple formats, including PDF and XPS. Developers can export TeX to PDF documents and images within their .NET solutions using the API methods. Converting LaTeX files to raster images is another functionality available to end users. In this section, we will learn how to programmatically convert TeX to PDF and LaTeX to JPG using the .NET typesetting API.

Convert TeX to PDF using C#

Let’s review the following coding example to learn how to accurately convert TeX to PDF using the .NET library for typesetting.

  • Create the typesetting options for the default ObjectTeX format.
  • Specify the console or memory stream as an output terminal.
  • Apply the options for rendering to PDF format.
  • Use the TexJob class constructor & save the output PDF with the PdfDevice class object.
String dataDir = @"D:\test\";
// Create typesetting options for the default ObjectTeX format.
TeXOptions options = TeXOptions.ConsoleAppOptions(TeXConfig.ObjectTeX());

// Specify a file system working directory for input.
options.InputWorkingDirectory = new InputFileSystemDirectory(dataDir);

// Specify a file system working directory for output.
options.OutputWorkingDirectory = new OutputFileSystemDirectory(dataDir);

// Specify memory stream as output terminal.
options.TerminalOut = new OutputMemoryTerminal();

// Set options for rendering into PDF format.
options.SaveOptions = new PdfSaveOptions();

// Run typesetting.
new TeXJob("hello-world", new PdfDevice(), options);

Convert LaTeX to JPG in .NET

Our library supports exporting LaTeX files to images, including PNG and JPG. The following example showcases converting LaTeX to JPG.

  • Load the input LaTeX file.
  • Create the conversion options using the TeXOptions class object.
  • Instantiate the JpegSaveOptions class object.
  • Perform LaTeX to JPG conversion using the TexJob class.
// Load the input LaTEX or TEX file
byte[] bytes = File.ReadAllBytes("helloworld.ltx");            
Stream stream = new MemoryStream(bytes);

// Create conversion options for Object LaTeX format on Object TeX engine extension.
TeXOptions options = TeXOptions.ConsoleAppOptions(TeXConfig.ObjectLaTeX);

// Specify the file system working directory for the output.
options.OutputWorkingDirectory = new OutputFileSystemDirectory(dataDir);

// Initialize the options for saving in JPG format.
options.SaveOptions = new JpegSaveOptions();

// Run LaTeX to JPG conversion.
new TeXJob(stream, new ImageDevice(), options).Run();

Please check out more complete coding examples of Aspose.TeX for .NET library on the GitHub examples page. You can view and convert TeX files from anywhere using your mobile devices with our Free Online TeX Viewer and Conversion Apps.

Develop Cross-platform .NET Typesetting Applications

Aspose.TeX for .NET is compatible with multiple frameworks and supports various popular operating systems. Owing to this cross-platform compatibility, developers can build feature-rich typesetting applications that can be easily integrated with the existing software modules. The .NET typesetting API can be used across different development environments for writing optimized application code. Experience platform-independent app development and create PDFs or great-quality raster and vector images using our API.


1. How can I process TeX and LaTeX files in .NET?

Processing TeX and LaTeX files is convenient using the Aspose.TeX for .NET library. Our library boasts typesetting ability for TeX files and supports generating PDFs, XPS documents, and images from TeX and LaTeX documents on the .NET platform.

2. How long it takes to process and convert files using the API?

Our API works fast and completes your file loading, processing, and conversion requests in no time.

3. Are code examples available for developers to learn about TeX and LaTeX document processing using the .NET library?

Yes, we provide coding examples for developers to help them with the initial learning curve. These code samples are available on the GitHub examples page of the .NET library for typesetting and cover various use cases for the library users.

4. Is the API secure for sensitive documents and data?

Yes, our API is secure for sensitive data. We ensure the safety and integrity of your data and take all necessary measures to protect your files processed using our products.

5. Is Aspose.TeX for .NET compatible with different .NET frameworks?

Absolutely! The .NET typesetting API is compatible with multiple .NET frameworks and runs smoothly on various operating systems. It does not require additional software installations to typeset TeX files.

Looking for help?

Checkout our support channels for help with your questions related to Aspose product API features and working.

Ready to get started?

Download Free Trial View All APIs