This guide explains how to merge XPS in C#. It includes the program workflow and the sample code to combine XPS files in C#. Furthermore, it also covers different properties to customize the conversion according to your requirements.
Steps to Merge XPS Files in C#
- Prepare the IDE by installing Aspose.Page for merging XPS files
- Get the input XPS file using the XPSDocument class
- Set custom options with the PdfSaveOptions class instance
- Declare a PDF rendering device using the PdfDevice class
- Define an array of the input XPS documents
- Merge the loaded XPS files as a single PDF file
These steps simplify the process to combine XPS in C#. Firstly, load the source XPS document and set different options to manipulate the output document. Subsequently, initiate a stream class object for exporting the output, and proceed to render the output file to the disk or stream.
Code to Combine XPS Files in C#
This quick code snippet showcases how to merge XPS to PDF in C#. You can customize the code to combine multiple XPS files or adjust the merging sequence. Additionally, you can configure various custom properties, including image and text compression, file encryption, and more.
This brief guide has discussed how to merge XPS files in C#. However, if you want to export XPS to an Image, refer to the article on Convert XPS to JPG Image in C#.