diff --git a/bower.json b/bower.json index f1d0f7d4f..3622546bb 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.1.230", + "version": "1.1.233", "main": [ "build/pdf.js", "build/pdf.worker.js" diff --git a/build/pdf.combined.js b/build/pdf.combined.js index e90968627..9f316fde4 100644 --- a/build/pdf.combined.js +++ b/build/pdf.combined.js @@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.1.230'; -PDFJS.build = '1da0b3a'; +PDFJS.version = '1.1.233'; +PDFJS.build = '0a744fb'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -534,7 +534,7 @@ Object.defineProperty(PDFJS, 'isLittleEndian', { } }); - // Lazy test if the userAgant support CanvasTypedArrays + // Lazy test if the userAgent support CanvasTypedArrays function hasCanvasTypedArrays() { var canvas = document.createElement('canvas'); canvas.width = canvas.height = 1; diff --git a/build/pdf.js b/build/pdf.js index 842e12d9e..87c7b712a 100644 --- a/build/pdf.js +++ b/build/pdf.js @@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.1.230'; -PDFJS.build = '1da0b3a'; +PDFJS.version = '1.1.233'; +PDFJS.build = '0a744fb'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -534,7 +534,7 @@ Object.defineProperty(PDFJS, 'isLittleEndian', { } }); - // Lazy test if the userAgant support CanvasTypedArrays + // Lazy test if the userAgent support CanvasTypedArrays function hasCanvasTypedArrays() { var canvas = document.createElement('canvas'); canvas.width = canvas.height = 1; diff --git a/build/pdf.worker.js b/build/pdf.worker.js index 0ddc9ca56..ff6defeb4 100644 --- a/build/pdf.worker.js +++ b/build/pdf.worker.js @@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.1.230'; -PDFJS.build = '1da0b3a'; +PDFJS.version = '1.1.233'; +PDFJS.build = '0a744fb'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -534,7 +534,7 @@ Object.defineProperty(PDFJS, 'isLittleEndian', { } }); - // Lazy test if the userAgant support CanvasTypedArrays + // Lazy test if the userAgent support CanvasTypedArrays function hasCanvasTypedArrays() { var canvas = document.createElement('canvas'); canvas.width = canvas.height = 1; diff --git a/package.json b/package.json index 2c1ab076e..6d8c093a1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.1.230", + "version": "1.1.233", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [ "Mozilla", diff --git a/web/pdf_viewer.js b/web/pdf_viewer.js index 78e61aacf..979dd2984 100644 --- a/web/pdf_viewer.js +++ b/web/pdf_viewer.js @@ -17,7 +17,7 @@ /*jshint globalstrict: false */ /* globals PDFJS, PDFViewer, PDFPageView, TextLayerBuilder, PDFLinkService, DefaultTextLayerFactory, AnnotationsLayerBuilder, PDFHistory, - DefaultAnnotationsLayerFactory, getFileName */ + DefaultAnnotationsLayerFactory, getFileName, ProgressBar */ // Initializing PDFJS global object (if still undefined) if (typeof PDFJS === 'undefined') { @@ -29,7 +29,8 @@ if (typeof PDFJS === 'undefined') { var CSS_UNITS = 96.0 / 72.0; -var DEFAULT_SCALE = 'auto'; +var DEFAULT_SCALE_VALUE = 'auto'; +var DEFAULT_SCALE = 1.0; var UNKNOWN_SCALE = 0; var MAX_AUTO_SCALE = 1.25; var SCROLLBAR_PADDING = 40; @@ -2079,7 +2080,8 @@ var PDFViewer = (function pdfViewer() { * @returns {number} */ get currentScale() { - return this._currentScale; + return this._currentScale !== UNKNOWN_SCALE ? this._currentScale : + DEFAULT_SCALE; }, /** @@ -2091,7 +2093,7 @@ var PDFViewer = (function pdfViewer() { } if (!this.pdfDocument) { this._currentScale = val; - this._currentScaleValue = val.toString(); + this._currentScaleValue = val !== UNKNOWN_SCALE ? val.toString() : null; return; } this._setScale(val, false); @@ -2195,7 +2197,7 @@ var PDFViewer = (function pdfViewer() { // Fetch a single page so we can get a viewport that will be the default // viewport for all pages return firstPagePromise.then(function(pdfPage) { - var scale = this._currentScale || 1.0; + var scale = this.currentScale; var viewport = pdfPage.getViewport(scale * CSS_UNITS); for (var pageNum = 1; pageNum <= pagesCount; ++pageNum) { var textLayerFactory = null; @@ -2453,10 +2455,10 @@ var PDFViewer = (function pdfViewer() { return; } - if (scale && scale !== this.currentScale) { + if (scale && scale !== this._currentScale) { this.currentScaleValue = scale; - } else if (this.currentScale === UNKNOWN_SCALE) { - this.currentScaleValue = DEFAULT_SCALE; + } else if (this._currentScale === UNKNOWN_SCALE) { + this.currentScaleValue = DEFAULT_SCALE_VALUE; } if (scale === 'page-fit' && !dest[4]) { @@ -3104,5 +3106,6 @@ var PDFHistory = (function () { PDFJS.PDFHistory = PDFHistory; PDFJS.getFileName = getFileName; + PDFJS.ProgressBar = ProgressBar; }).call((typeof window === 'undefined') ? this : window);