Product Family

Convert PDF to XPS via C++

Native and high-performance PDF file creation without Adobe Acrobat installation using C++.

How to Convert PDF to XPS Using C++

In order to convert PDF to XPS, we’ll use Aspose.PDF for C++ API which is a feature-rich, powerful and easy to use document manipulation and conversion API for C++ platform. Open NuGet package manager, search for Aspose.PDF and install. You may also use the following command from the Package Manager Console.

Package Manager Console Command

PM> Install-Package Aspose.PDF


<version>version of aspose-pdf API</version>

Steps to Convert PDF to XPS via C++

C++ developers can easily load & convert PDF files to XPS in just a few lines of code.

  1. Initialize a new Document
  2. Call the Document.Save method while passing the output file path & SaveFormat.Xps as parameters
  3. Finally, save the output XPS file

System Requirements

Aspose.PDF for C++is supported on all major operating systems. Just make sure that you have the following prerequisites.



This sample code shows PDF to XPS C++ Conversion

// Load the PDF.
auto doc = MakeObject<Document>(u"sourceFile.pdf");

// Save in XPS format.
doc->Save(u"convertedFile.xps", SaveFormat::Xps);
  • Convert PDF to XPS via Online App