I have a document viewer and XPS atm since I have not tried this before. Therefore, I have a simple piece of code that downloads an XPS document and displays it in the document viewer, but the document does not appear. The document viewer loads, and a quick switch to debug mode tells me that there is information, it just does not appear.
dvDoc = new DocumentViewer(); string fileName = null; string appPath = System.IO.Path.GetDirectoryName(Assembly.GetAssembly(typeof(DocumentWindow)).CodeBase); if (type == "About") fileName = appPath + @"\Documents\About.xps"; fileName = fileName.Remove(0, 6); XpsDocument doc = new XpsDocument(fileName, FileAccess.Read); dvDoc.Document = doc.GetFixedDocumentSequence();
All the literature I can find tells me to do it this way, but for me it doesn't seem to work. I know that the document viewer does not like URIs, therefore filename.remove line.
Any suggestions regarding what I am missing.
Cheers, SumGuy
c # wpf xps documentviewer
Sumguy
source share