How to load an XPS document into the DocumentViewer?

Platform: WPF| Category: DocumentViewer

XPS documents can be easily loaded into the documentviewer.

Here’s the code snippet.

[XAML]
          
   <DocumentViewer Name='documentViewer' />
[C#]

   XpsDocument xpsDocument = new XpsDocument('sample.xps', FileAccess.Read);
   documentViewer.Document = xpsDocument;

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.