Office and PDF Silverlight Viewer

Skip to first unread message


Feb 24, 2014, 5:15:51 AM2/24/14

I want the option to preview documents or PDF files in silverlight 5.0.

Would somebody please provide some guidance on this? Please provide some steps.

How can we achieve this?


Matt Parizeau

Feb 24, 2014, 2:33:54 PM2/24/14

As shown here, WebViewer works by taking the original document and converting to XOD.  This can be done ahead of time, outputting a XOD file or it can be done on the fly (for example from a XOD byte array).  This post has some information about the tradeoffs between converting ahead of time and streaming.

As the getting started page shows, you'll need to use PDFNet, DocPub or PWS Cloud to convert to XOD.  If you want to convert on the fly you'll need to use PDFNet.  You can take a look at the WebViewer Streaming Sample in the PDFNet download under the samples folder for more information about using WebViewer with streaming.  One thing to note is that if you're converting office documents than you'll need to be using a Windows server with Microsoft Office installed.

By default WebViewer uses HTML5 as its preferred technology, and if that isn't supported it falls back to Silverlight or Flash.  To force it to use Silverlight by default you can set the option type: "silverlight".  For example new PDFTron.WebViewer({ type: "silverlight", ...}).  For more information you can find WebViewer documentation here:

Matt Parizeau
Software Developer
PDFTron Systems Inc.
Reply all
Reply to author
0 new messages