box / box/viewer.js

Number of pages loaded initially is 2X MAX_PAGE_LOAD_RANGE

Open
#202 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
333
Forks
98
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

Research direction

Start with the viewer configuration in the issue and trace how MAX_PAGE_LOAD_RANGE controls the initial page loading and pageunload behavior. Determine whether that setting has a supported configuration entry point, then verify the result using the reported pageload and pageunload events; done means the initial load range can be controlled without changing source, or the limitation is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.