Learn to use the NiPDF SDK

Convert XPS file to a PDF file

This example demostrates the conversion of an XPS file to a PDF file.
This is extremely straightforward. Alternatively one could use the NiXPS.Converter.XpsToPdf() function to work with memorystreams in stead of files.

The following NiPDF function is used: NiXPS.Converter.XpsToPdfWithFile()

Source listing:

using System;

partial class Test
{
    public static void example0002_ConvertXPS(string pIn, string pOut)
    {
        // Convert XPS file to PDF file in one line of code
        NiXPS.Converter.XpsToPdfWithFile(pIn, pOut);
    }
}

(Required assembly references: NiPDF)