C# – Can we Converting the xps document to Pdf programmatically using C#

cpdfxps

I am new to the xps documents. I have requirement like convert xps doucment to Pdf format. Can any body have an idea how to do this.

Can u give me any code samples.

Thanks in Advance..

Mehar

Best Answer

woof woof!

you can use

ghostpdl

ghostpdl is a set of three utilities

pcl6
gxps
gsvg

to convert the file to PDF format. GhostPDL can handle SVG (and XPS or PCL) in a similar way as Ghostscript does handle PostScript

a sample of how to convert xps to pdf with gsvg

gxps -dNOPAUSE -dBATCH -dSAFER -sOutputFile=my.pdf -sDEVICE=pdfwrite file.xps