Integrating PDFNet WebViewer with a WPF application

Q: We purchased PDFNet WebViewer SDK (http://www.pdftron.com/pdfnet/webviewer/demo.html) and now we need to port the existing functionality of our Silverlight document viewer to WPF. Is there a port available from your sample document viewer where we can add in our additional functionality to it. We have a requirement now to have the XOD documents viewable by internal client software written in WPF.

I suppose the SilverDox.dll cannot be used and linked in by a WPF application?

A: Unfortunately WPF and Silverlight are not fully compatible (http://msdn.microsoft.com/en-us/library/cc903925(v=vs.95).aspx)), so you will probably run into some issues if you directly reference Silverdox.dll in a WPF project.

At the same time, you should be able to host a Silverlight control in a browser control within WPF app or by using Silverlight control directly (e.g. http://silverlightviewport.codeplex.com/ … etc).

Now SilverDox / PDFNet WebViewer XOD files are just XPS files (http://en.wikipedia.org/wiki/Open_XML_Paper_Specification), so you should be able to use WPF FixedPage document & viewer (http://msdn.microsoft.com/en-us/library/system.windows.controls.documentviewer.aspx).

Alternatively you could use pdftron.PDF.Convert.FromXps() and load XOD/XPS in PDFTron’s PDFViewWPFCtrl or PDFViewCtrl (both of which offer build-in annotation support etc). Starting with v5.8 - PDFNet SDK includes WPF control with the similar type of functionality as SilverDox. As an example, please see PDFViewWPF sample which is included as part of .NET 4+ SDK distribution (http://www.pdftron.com/pdfnet/downloads.html).