Convert TeX to PDF or XPS File Programmatically using C++

TeX files are used for typesetting different documents and books containing text, symbols, and arithmetic expressions. In addition, these files can generate outputs like PDF, XPS, and various image formats. In this article, you will learn how to convert TeX files to XPS and PDF format using C++.

C++ API for Converting TeX to PDF and XPS Format

Aspose.TeX for C++ is a C++ library for working with TeX files without requiring any additional software to be installed. The API allows you to typeset TeX files and generate output in formats like XPS, PDF, PNG, JPEG, TIFF, BMP. You can either install the API through NuGet or download it directly from the Downloads section.

PM> Install-Package Aspose.TeX.Cpp

Convert TeX to XPS Format using C++

You can convert TeX files to XPS format in just a few lines of code. To achieve this, please follow the steps given below.

The following sample code demonstrates how to convert a TeX file to XPS format using C++.

Converting TeX to PDF Format using C++

The following are the steps to convert TeX files to PDF format.

The following sample code shows how to convert a TeX file to PDF format using C++.

Convert TeX ZIP directory to PDF ZIP Directory using C++

In order to convert multiple TeX files to PDF format in one go, you can add the TeX files to a ZIP archive and convert them to zipped PDF files. The following are the steps to achieve this.

The following sample code shows how to convert TeX ZIP archive to PDF ZIP archive using C++.

Get a Free License

You can try the API without evaluation limitations by requesting a free temporary license.

Conclusion

In this article, you have learned how to convert TeX files to XPS and PDF format using C++. Furthermore, you have learned how to convert TeX files in a ZIP archive to zipped PDF files. Aspose.TeX for C++ provides many additional features for working with TeX files. You can explore the API in detail by visiting the official documentation. In case of any questions, please feel free to reach us on our free support forum.

See Also