How to enable content fetching page by page

108 views
Skip to first unread message

Anatoly Kudrevatukh

unread,
Feb 11, 2016, 1:52:06 PM2/11/16
to PDFTron WebViewer
Q: Could you let us know where we set the variable to load content page by page or possibly 3 pages at a time, instead of continuing to download the entire XOD file in the background as some of our proposed locations are bandwidth constrained.

A:
If you are using non-streaming mode (https://www.pdftron.com/webviewer/demo/tutorials/streaming-option.html) , aka HttpPartRetriever then WebViewer already is only downloading parts.

You can further tune number of pages being requested and rendered with SetPreRenderLevel function (https://www.pdftron.com/webviewer/demo/lib/html5/doc/symbols/CoreControls.html#.SetPreRenderLevel)

exports.CoreControls.SetPreRenderLevel(0); 

Will set it to just visible pages.

Donald Gordon

unread,
Apr 7, 2016, 12:48:46 PM4/7/16
to PDFTron WebViewer
Would it be possible to add a parameter like the "streaming" config option that was mindlessly obeyed by webviewer?  Webviewer's "does HTTP range work?" check is run against the server hosting the WebViewer JS files, not the XOD document itself.  At present I can set streaming:false, and WebViewer will perform a test against the server it's javascript is loaded from, and end up running in streaming mode anyway.

If you wanted to avoid support calls you could always give it a name like "dangerouslyForceStreamingToOff" or similar :-)

Regards

Donald

Matt Parizeau

unread,
Apr 8, 2016, 3:47:56 PM4/8/16
to PDFTron WebViewer
Hi Donald,

We could consider this for a future version. For now you can do this:
window.ControlUtils.byteRangeCheck = function(onSuccess) {
    onSuccess
(206);
};

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