This code sample is just few lines of code. You can find it here, at the very end of the MSDN help page on the class
System.Windows.Xps.Packaging.XpsDocument
in the section "Community Content":
http://msdn.microsoft.com/en-us/library/system.windows.xps.packaging.xpsdocument.aspx[
^].
Don't forget: you need to add the reference to the assembly "ReachFramework.DLL" which is bundled with .NET Framework v.3.5 and later, so add it from the ".NET" tab of the window "Add Reference".
The idea is:
string fileName;
System.Windows.Controls.DocumentViewer viewer;
System.Windows.Xps.Packaging.XpsDocument doc =
new System.Windows.Xps.Packaging.XpsDocument(fileName, System.IO.FileAccess.Read);
viewer.Document = doc.GetFixedDocumentSequence();
It works, tested.
—SA