Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save aspose-com-gists/1d10927e18d23e49096c91ce726e9d6f to your computer and use it in GitHub Desktop.

Select an option

Save aspose-com-gists/1d10927e18d23e49096c91ce726e9d6f to your computer and use it in GitHub Desktop.
Convert LaTeX to XPS with .NET

Aspose.TeX for .NET – Convert LaTeX to XPS Examples

These snippets demonstrate converting LaTeX documents to XPS format with Aspose.TeX for .NET. Convert LaTeX to XPS with flexible configuration options for professional typesetting and document processing.

Key Use Cases

  • Convert LaTeX to XPS
  • How to convert LaTeX to XPS with stream output

How to Run Examples

  1. Reference Aspose.TeX for .NET: Aspose.TeX on Windows; Aspose.TeX.Drawing on non‑Windows.
  2. Copy a snippet into your project.
  3. Apply a temporary license as described in the licensing guide.
  4. Build and run.

Restrictions

In evaluation mode, the output may contain watermarks and limitations. Apply a valid license to unlock full features.

Related Documentation

More about LaTeX to XPS conversion:

Related Resources

Requirements

  • .NET 6.0+, .NET Core, or .NET Framework
  • Aspose.TeX for .NET library
Aspose.TeX for .NET – Convert LaTeX to XPS Examples
// Convert LaTeX to XPS - alternative approach with stream
// Learn more: https://docs.aspose.com/tex/net/latex-to-xps/
// Create the stream to write the XPS file to.
using (Stream xpsStream = File.Open(Path.Combine(OutputDir, "hello-world-alt.xps"), FileMode.Create))
{
// Create conversion options for Object LaTeX format upon Object TeX engine extension.
TeXOptions options = TeXOptions.ConsoleAppOptions(TeXConfig.ObjectLaTeX);
// Specify a file system working directory for the output.
options.OutputWorkingDirectory = new OutputFileSystemDirectory(OutputDir);
// Initialize the options for saving in XPS format.
options.SaveOptions = new XpsSaveOptions(); // Default value. Arbitrary assignment.
// Run LaTeX to XPS conversion.
new TeXJob(Path.Combine(DataDir, "hello-world.ltx"), new XpsDevice(xpsStream), options).Run();
}
// Convert LaTeX to XPS - simplest approach
// Learn more: https://docs.aspose.com/tex/net/latex-to-xps/
// Create conversion options for Object LaTeX format upon Object TeX engine extension.
TeXOptions options = TeXOptions.ConsoleAppOptions(TeXConfig.ObjectLaTeX);
// Specify a file system working directory for the output.
options.OutputWorkingDirectory = new OutputFileSystemDirectory(OutputDir);
// Initialize the options for saving in XPS format.
options.SaveOptions = new XpsSaveOptions();
// Run LaTeX to XPS conversion.
new TeXJob(Path.Combine(DataDir, "hello-world.ltx"), new XpsDevice(), options).Run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment