From 8170d67a6b5df646a30154b5a0235cd99deeabe3 Mon Sep 17 00:00:00 2001 From: Jonas Date: Fri, 2 Aug 2013 16:09:33 +0200 Subject: [PATCH] Fix issue with initial scale when opening a new file and another one is already loaded --- web/viewer.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/viewer.js b/web/viewer.js index fb6b3aecd..ed19a8286 100644 --- a/web/viewer.js +++ b/web/viewer.js @@ -1030,6 +1030,11 @@ var PDFView = { // updated if the zoom level stayed the same. this.currentScale = 0; this.currentScaleValue = null; + // When opening a new file (when one is already loaded in the viewer): + // Reset 'currentPageNumber', since otherwise the page's scale will be wrong + // if 'currentPageNumber' is larger than the number of pages in the file. + document.getElementById('pageNumber').value = currentPageNumber = 1; + if (PDFHistory.initialDestination) { this.navigateTo(PDFHistory.initialDestination); PDFHistory.initialDestination = null;