Extract a single page from an XPS document

依然范特西╮ 提交于 2019-12-04 16:03:39
  1. Open the XpsDocument
  2. Create the destination XpsDocument (same method)
  3. Get the FixedDocumentSequece from the first XpsDocument
  4. Get the first FixedDocument from the sequence.
  5. Get the first PageContent from the Pages property
  6. Get the FixedPage from the Child property of the PageContent
  7. Get the XpsDocumentWriter from the second XpsDocument
  8. Write the FixedPage

Easy.


As noted by Christopher Currens, it may be necessary to use PageContent.GetPageRoot instead of Child in step 6.

Thank you, it can help a lot people looking for a workaround against limitation of Xps printing which ignores PrintTicket defined at page level.

https://connect.microsoft.com/VisualStudio/feedback/details/529120/printqueue-addjob-ignores-printtickets-in-xps-documents

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!