Foxit PDF SDK for Web 6.2 Foxit WebPDF Viewer – Discontinued

Is it possible to retrieve a file from an external server using WebPDF Viewer?

Is it possible to retrieve a file from an external server using WebPDF Viewer?

Yes. To achieve the file retrieve using WebPDF Viewer, follow the steps below:

1 – Deploy your own document server. We provide Foxit WebPDF users with a Java sample code for reference. It is available in ‘webpdf\sample\webpdf-extension-sample’, specifically , DocumentController.java
2 – Modify the
javascript file apiConfig.js located in ‘webpdf\viewer\webapp\scripts\config’ by removing the comments in the getDocument function of the REST API and replace the “url” field with the address of the server where the document you want is located.
3 – Call

params = { url: the file url}
WebPDF.ViewerInstance.openFileByUri(params)

which will trigger the REST API getDocument , send a HTTP request to the server and retrieve the document.

4 – You may pass your own parameter in the “params” and “heads” field in apiConfig.js

Updated on March 5, 2019

Was this article helpful?
Thanks for your feedback. If you have a comment on how to improve the article, you can write it here: