Created
October 21, 2025 21:39
-
-
Save aspose-com-gists/564e395261f5cb4805ab5367bdf8d7f2 to your computer and use it in GitHub Desktop.
Convert LaTeX to XPS in Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from aspose.tex import * | |
| from aspose.tex.io import * | |
| from aspose.tex.presentation.xps import * | |
| import aspose.tex as tex | |
| from os import path | |
| from datetime import datetime | |
| from io import BytesIO | |
| license_path = "license.lic" | |
| # Apply Aspose.Tex license | |
| license = tex.License() | |
| license.set_license(license_path) | |
| # Create conversion options for Object LaTeX format upon Object TeX engine extension. | |
| options = TeXOptions.console_app_options(TeXConfig.object_latex) | |
| # Set interaction mode. | |
| options.interaction = Interaction.NONSTOP_MODE | |
| # Specify the address for the working directory. | |
| options.input_working_directory = InputFileSystemDirectory("input") | |
| options.output_working_directory = OutputFileSystemDirectory("output") | |
| # Initialize an instance of the XpsSaveOptions class. | |
| so = XpsSaveOptions() | |
| options.save_options = so | |
| # Run LaTeX to XPS conversion by calling the run method. | |
| TeXJob("sample.ltx", XpsDevice(), options).run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment