Convert XPS to PDF in WPF C# application

David MZ picture David MZ · Jun 18, 2011 · Viewed 13.4k times · Source

I need to convert an XPS file I create with my application to a PDF file, what is the best way to do so? I prefer this to be done from inside C# using a managed assembly.

Open source is preferred upon third party solutions

Answer

Jim picture Jim · Jun 18, 2011

You can use the XpsDocument class to read the XPS files, then use a PDF library (such as Report.Net or #PDF) to export it. I used #PDF back in .NET 1.1, but not sure if it can be easily converted to .NET 2.0.

#PDF: http://sharppdf.sourceforge.net/

Report.NET: http://report.sourceforge.net/