How can I load XOD files from a server file path?

90 views
Skip to first unread message

Kevin Kuo

unread,
Dec 3, 2014, 5:59:49 PM12/3/14
to pdfnet-w...@googlegroups.com
Q: How can I load XOD files from a server file path (e.g. C:\files\document.xod)?

==========================================
A: 
Because WebViewer is a client-side HTML5 application, it cannot load files from local paths.

We recommend that you host your XOD documents as static files on your web server.
(i.e. your XOD files should be accessible through a URL like http://myserver.com/files/document.xod)

If you are concerned with security and do not want your XOD files to be accessible to the public, we recommend still hosting XOD files statically, but set up additional security measures.
For example, you can configure Basic Authentication on your server.
The following URL shows how to add an authentication header to WebViewer's requests.
You could also set up secure intranets, firewalls, etc.

Alternatively, you can have a server-side script that loads files from your server file path and returns it in a HTTP response.
PDFNet SDK has a sample in ASP.NET called "WebViewerStreamingSample" that shows something similar. The sample converts PDFs to XOD on the fly and returns it, but in this case, you would simply load the XOD file and return that.
However, this is not ideal because you don't get the benefit of byte range requests and other optimizations that web servers do when serving static files.



Reply all
Reply to author
Forward
0 new messages