viewer.js icon indicating copy to clipboard operation
viewer.js copied to clipboard

Number of pages loaded initially is 2X MAX_PAGE_LOAD_RANGE

Open harish278 opened this issue 10 years ago • 6 comments

Hi,

Number of pages loaded when I'm in 1st page is 2X MAX_PAGE_LOAD_RANGE. Which is quiet heavy.

Is there any way to configure MAX_PAGE_LOAD_RANGE. (Without changing source)

This is the current configurations that I'm using.

viewer = Crocodoc.createViewer('.viewer', {
    url: "./InTimeOktoober14/assets",
    layout: Crocodoc.LAYOUT_VERTICAL_SINGLE_COLUMN,
    enableTextSelection: true,
    enableDragging: false,
    useWindowAsViewport: true
});
viewer.on('pagefocus', function (event) {
    console.log(event.data.page);
});

// This is how I got to know number of pages loaded.
viewer.on('pageload', function (event) {
    console.log("loaded", event.data.page);
});
viewer.on('pageunload', function (event) {
    console.log("unloaded", event.data.page);
});
viewer.load();

Please suggest, thanks in advance.

harish278 avatar Sep 15 '15 08:09 harish278

There are two parts to this issue:

  1. A possible bug: Number of pages loaded when in 1st page is 2X MAX_PAGE_LOAD_RANGE/MAX_PAGE_LOAD_RANGE_MOBILE.
  2. Request for having MAX_PAGE_LOAD_RANGE and MAX_PAGE_LOAD_RANGE_MOBILE as configurable values.

harish278 avatar Sep 23 '15 07:09 harish278

having the same issue.

vdclouis avatar Feb 19 '16 09:02 vdclouis

Same issue. Did we get anywhere on this. I'm using version 0.11.0 and still got the same problem.

patbegg avatar Apr 28 '16 07:04 patbegg

I tried looking into the code, but could not find the root cause. We just went ahead and divided our max load range by 2 :o

vdclouis avatar Apr 28 '16 07:04 vdclouis

@vdclouis did you find a workaround then it sounds like? yeah I really would like this to just only request a few pages in range around whats visible at a time. it blocks the ui in my case from responding until all the initial requests are completed. 😦

kellyrmilligan avatar Aug 11 '17 13:08 kellyrmilligan

or did you just download the source and change the constant variable in the dist?

kellyrmilligan avatar Aug 11 '17 13:08 kellyrmilligan