Browse Source

PDF.js version 1.6.283 - See mozilla/pdf.js@e9c63a2b3274e7fc851fcdc0761bec7eefb3f4b6

master v1.6.283
Pdf Bot 9 years ago
parent
commit
32d204ae52
  1. 2
      bower.json
  2. 4
      build/pdf.combined.js
  3. 4
      build/pdf.js
  4. 4
      build/pdf.worker.js
  5. 2
      package.json
  6. 59
      web/pdf_viewer.js

2
bower.json

@ -1,6 +1,6 @@
{ {
"name": "pdfjs-dist", "name": "pdfjs-dist",
"version": "1.6.279", "version": "1.6.283",
"main": [ "main": [
"build/pdf.js", "build/pdf.js",
"build/pdf.worker.js" "build/pdf.worker.js"

4
build/pdf.combined.js

@ -24,8 +24,8 @@
}(this, function (exports) { }(this, function (exports) {
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
'use strict'; 'use strict';
var pdfjsVersion = '1.6.279'; var pdfjsVersion = '1.6.283';
var pdfjsBuild = 'a740d69'; var pdfjsBuild = 'e9c63a2';
var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null;
var pdfjsLibs = {}; var pdfjsLibs = {};
(function pdfjsWrapper() { (function pdfjsWrapper() {

4
build/pdf.js

@ -24,8 +24,8 @@
}(this, function (exports) { }(this, function (exports) {
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
'use strict'; 'use strict';
var pdfjsVersion = '1.6.279'; var pdfjsVersion = '1.6.283';
var pdfjsBuild = 'a740d69'; var pdfjsBuild = 'e9c63a2';
var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null;
var pdfjsLibs = {}; var pdfjsLibs = {};
(function pdfjsWrapper() { (function pdfjsWrapper() {

4
build/pdf.worker.js vendored

@ -24,8 +24,8 @@
}(this, function (exports) { }(this, function (exports) {
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
'use strict'; 'use strict';
var pdfjsVersion = '1.6.279'; var pdfjsVersion = '1.6.283';
var pdfjsBuild = 'a740d69'; var pdfjsBuild = 'e9c63a2';
var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null;
var pdfjsLibs = {}; var pdfjsLibs = {};
(function pdfjsWrapper() { (function pdfjsWrapper() {

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "pdfjs-dist", "name": "pdfjs-dist",
"version": "1.6.279", "version": "1.6.283",
"main": "build/pdf.js", "main": "build/pdf.js",
"description": "Generic build of Mozilla's PDF.js library.", "description": "Generic build of Mozilla's PDF.js library.",
"keywords": [ "keywords": [

59
web/pdf_viewer.js

@ -2096,6 +2096,7 @@
var renderInteractiveForms = options.renderInteractiveForms || false; var renderInteractiveForms = options.renderInteractiveForms || false;
this.id = id; this.id = id;
this.renderingId = 'page' + id; this.renderingId = 'page' + id;
this.pageLabel = null;
this.rotation = 0; this.rotation = 0;
this.scale = scale || DEFAULT_SCALE; this.scale = scale || DEFAULT_SCALE;
this.viewport = defaultViewport; this.viewport = defaultViewport;
@ -2494,6 +2495,17 @@
self.onBeforeDraw(); self.onBeforeDraw();
} }
return promise; return promise;
},
/**
* @param {string|null} label
*/
setPageLabel: function PDFView_setPageLabel(label) {
this.pageLabel = typeof label === 'string' ? label : null;
if (this.pageLabel !== null) {
this.div.setAttribute('data-page-label', this.pageLabel);
} else {
this.div.removeAttribute('data-page-label');
}
} }
}; };
return PDFPageView; return PDFPageView;
@ -3100,7 +3112,8 @@
} }
var arg = { var arg = {
source: this, source: this,
pageNumber: val pageNumber: val,
pageLabel: this._pageLabels && this._pageLabels[val - 1]
}; };
this._currentPageNumber = val; this._currentPageNumber = val;
this.eventBus.dispatch('pagechanging', arg); this.eventBus.dispatch('pagechanging', arg);
@ -3109,6 +3122,27 @@
this._resetCurrentPageView(); this._resetCurrentPageView();
} }
}, },
/**
* @returns {string|null} Returns the current page label,
* or `null` if no page labels exist.
*/
get currentPageLabel() {
return this._pageLabels && this._pageLabels[this._currentPageNumber - 1];
},
/**
* @param {string} val - The page label.
*/
set currentPageLabel(val) {
var pageNumber = val | 0;
// Fallback page number.
if (this._pageLabels) {
var i = this._pageLabels.indexOf(val);
if (i >= 0) {
pageNumber = i + 1;
}
}
this.currentPageNumber = pageNumber;
},
/** /**
* @returns {number} * @returns {number}
*/ */
@ -3279,11 +3313,34 @@
} }
}.bind(this)); }.bind(this));
}, },
/**
* @param {Array|null} labels
*/
setPageLabels: function PDFViewer_setPageLabels(labels) {
if (!this.pdfDocument) {
return;
}
if (!labels) {
this._pageLabels = null;
} else if (!(labels instanceof Array && this.pdfDocument.numPages === labels.length)) {
this._pageLabels = null;
console.error('PDFViewer_setPageLabels: Invalid page labels.');
} else {
this._pageLabels = labels;
}
// Update all the `PDFPageView` instances.
for (var i = 0, ii = this._pages.length; i < ii; i++) {
var pageView = this._pages[i];
var label = this._pageLabels && this._pageLabels[i];
pageView.setPageLabel(label);
}
},
_resetView: function () { _resetView: function () {
this._pages = []; this._pages = [];
this._currentPageNumber = 1; this._currentPageNumber = 1;
this._currentScale = UNKNOWN_SCALE; this._currentScale = UNKNOWN_SCALE;
this._currentScaleValue = null; this._currentScaleValue = null;
this._pageLabels = null;
this._buffer = new PDFPageViewBuffer(DEFAULT_CACHE_SIZE); this._buffer = new PDFPageViewBuffer(DEFAULT_CACHE_SIZE);
this._location = null; this._location = null;
this._pagesRotation = 0; this._pagesRotation = 0;

Loading…
Cancel
Save