Convert XPS to PDF
Aspose.PDF for .NET support feature converting XPS files to PDF format. Check this article to resolve your tasks.
The XPS file type is primarily associated with the XML Paper Specification by Microsoft Corporation. The XML Paper Specification (XPS), formerly codenamed Metro and subsuming the Next Generation Print Path (NGPP) marketing concept, is Microsoft’s initiative to integrate document creation and viewing into its Windows operating system.
In order to convert XPS to PDF with Aspose.PDF for .NET, we have introduced a class named XpsLoadOption which is used to initialize a LoadOptions object. Later, this object is passed as an argument during the Document object initialization and it helps the PDF rendering engine to determine the source document’s input format.
The following code snippet shows the process of converting XPS file into PDF format with C#.
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.PDF-for-.NET // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdf_DocumentConversion(); // Instantiate LoadOption object using XPS load option Aspose.Pdf.LoadOptions options = new XpsLoadOptions(); // Create document object Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(dataDir + "XPSToPDF.xps", options); // Save the resultant PDF document document.Save(dataDir + "XPSToPDF_out.pdf");