I have XPS documents being generated from XAML User Controls that act as templates. I want to convert the XPS documents into alternative formats, mainly PDF, programmatically with a .NET based API.
What is the best way to do this?
I have XPS documents being generated from XAML User Controls that act as templates. I want to convert the XPS documents into alternative formats, mainly PDF, programmatically with a .NET based API.
What is the best way to do this?
The way I have done this in the past is print my XPS file to a PDF printer. I use cutePDF for this. So when you select to print, you print to cutePDF which prints a PDF version.
I am not sure if this will meet your needs but it has worked well for me in the past.
You can also use ABCpdf PDF Component for .NET . Version 7 can serve your purpose. see http://www.websupergoo.com/abcpdf-12.htm.
it provides fully funtional trial version unlike NiXPS and almost equally as fast as NiXPS.
You can use pdftron.PDF.Convert.FromXPS(...) to convert from XPS/XAML/FloawDocument and pdftron.PDF.Convert.ToXPS(...) to convert from PDF to XPS.
As a sample check out Xaml2PDF and Convert samples in PDFTron PDFNet SDK: http://www.pdftron.com/pdfnet/samplecode.html#Xaml2PDF
Nick