how to get a page from a xps file?

1.3k Views Asked by At

I'm writting an application in c# that take a Xps Document and create another xps documet that contains only one selected page from the original document, I was searching for an API that work with XPS files but I don't find anyone that do this work.

Please help me.

Thanks

2

There are 2 best solutions below

0
On

Have you tried looking in System.Windows.Xps.Packaging? That seems to contain everything you'll need to pull apart an XPS document and generate a new one.

0
On

You might also try looking into GhostXPS. It isn't an API per se, but you could call the application via System.Process to convert. Documentation is a bit light but you can probably use the help switch (-?) on the application to figure it out. Glancing at that help output, it does seem to support page operations.