Search code examples
c#xps

How to enumerate resources inside XPS file?


How can I access/read Resources inside an XPS package?

using (var doc = new System.Windows.Xps.Packaging.XpsDocument(filename, System.IO.FileAccess.Read))
{
    // how to read XpsResources? 
    // like XpsFont, XpsImage,... ?      
}

Solution

  • Take a look at the following MSDN pages:

    XpsDocument.FixedDocumentSequenceReader and IXpsFixedPageReader

    There are some code snippets there which should help with what you need, as well as looking at the IXpsFixedPageReader Properties.