Convert XPS with Aspose.Page C++ API

This article explains how to convert XPS files using C++ on the example of XPS to PDF Conversion.

Aspose.Page lets you convert XPS files using C++ in high-quality BMP, JPG, TIFF, PNG, and PDF documents.

You can check the quality of Aspose.Page XPS to PDF conversion and view the results via free online XPS to PDF Converter

Aspose.Page C++ XPS to PDF converter allows conversion of XPS documents to PDF on Windows and Linux.

It is necessary to do several steps to perform XPS to PDF conversion:

  1. Initialize an output stream for output PDF document.
  2. Initialize an input stream for the input XPS document.
  3. Create an instance of XpsDocument from created earlier input stream.
  4. Specify TextCompressionImageCompressionJpegQualityLevel, and other options of PdfSaveOptions.
  5. Create an instance of PdfDevice from created earlier output stream.
  6. Save the XPS document as a PDF with PDF save options.

Еру аollowing code snippet shows how to convert XPS to PDF document in C++:


For complete examples and data files, please go to

See XPS to PDF conversion in .Net and Java.

Let’s consider PdfSaveOptions. Using this class we can assign different conversion parameters while converting XPS to PDF.

For converting XPS to an image format there are the following parameters here:

Check XPS conversion online on our XPS cross-platform Converter. You can convert several XPS files to PDF at once and download results in a few seconds.

You can download examples and data files from GitHub.

Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.