Convert XPS, OXPS to JPG or PNG Image using C++

XPS and OXPS documents are similar to PDF files and define the layout, appearance, and printing information for a document. There might be scenarios where you might need to convert XPS and OXPS documents to JPG and PNG image formats. To that end, this article will teach you how to convert XPS and OXPS documents to JPG and PNG image format using C++.

C++ API for Converting XPS, OXPS Files to JPG or PNG Format

Aspose.Page for C++ is a C++ library for rendering and manipulating XPS and PostScript files. It allows you to create, read and update XPS documents. Furthermore, the API supports converting XPS and OXPS documents to JPG and PNG image formats. You can either install the API through NuGet or download it directly from the downloads section.

PM> Install-Package Aspose.Page.Cpp

Convert XPS/OXPS Documents to JPG Format

The following are the steps to convert XPS and OXPS documents to JPG format.

The following sample code shows how to convert XPS/OXPS documents to JPG format using C++.

JPG image generated by the sample code

JPG image generated by the sample code

Convert XPS/OXPS Documents to PNG Format

The following are the steps to convert XPS and OXPS documents to PNG format.

The following sample code shows how to convert XPS/OXPS documents to PNG format using C++.

PNG image generated by the sample code

PNG image generated by the sample code

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 XPS and OXPS documents to JPG and PNG image formats using C++. Furthermore, Aspose.Page for C++ API provides various additional formats for you to use. 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