FitPage only operating on dimensions of first page

59 views
Skip to first unread message

sbi

unread,
Jan 30, 2017, 4:56:46 AM1/30/17
to PDFTron WebViewer
Hi,

we have a lot of customer documents that have the following properties:

- First and last page is a normal cover with DinA 4 portrait dimensions
- All following pages are landscape DinA 3 (so like two covers next to each other)

This seems to mess with FitPage in Cover mode.
What seems to be happening is that the FitPage mode calculates the width the view should be constrained to by only looking at the first (or the first two pages).
This results in only 1 and a half page being visible on all pages after the cover.

Is there any way we (or you) could fix this?

Justin Jung

unread,
Jan 31, 2017, 4:29:46 PM1/31/17
to PDFTron WebViewer
Yes, the current implementation of fit modes assume constant page dimensions.
We will look into proper way of handling documents with different page dimensions.
For now, you can add the following to config.js to fix the issue.

$(document).on('viewerLoaded', function() {
  readerControl
.docViewer.on('pageNumberUpdated', function() {
   
if (readerControl.docViewer.getDisplayModeManager().getDisplayMode().isContinuous()) {
     
return;
   
}
    setTimeout
(function() {
      readerControl
.setFitMode(readerControl.getFitMode());
   
}, 0);
 
});
});

Justin Jung
Software Developer
PDFTron Systems Inc.

sbi

unread,
Feb 1, 2017, 8:39:01 AM2/1/17
to PDFTron WebViewer
Hi Justin,

thanks für the quick response. The workaround seems to be working for now.

sbi

unread,
Oct 24, 2018, 10:48:09 AM10/24/18
to PDFTron WebViewer
Will there be a proper fix for this issue now that WebViewer 4.0 and the new UI is released?


Am Dienstag, 31. Januar 2017 22:29:46 UTC+1 schrieb Justin Jung:

Justin Jung

unread,
Oct 29, 2018, 2:04:12 PM10/29/18
to pdfnet-w...@googlegroups.com
Hi,

We had an internal discussion about this when releasing v4.0, and it was postponed for now until there are further requests from more users.
Once we get enough data about different used-cases and how the current behavior lacks supporting them, we will come up with a more generalized solution.
Reply all
Reply to author
Forward
0 new messages