Browse Source

PDF.js version 1.8.423 - See mozilla/pdf.js@8654635b0b97b1e1df2d7164c6d39db6da5e6fcd

master v1.8.423
pdfjsbot 8 years ago
parent
commit
46bf54a001
  1. 2
      bower.json
  2. 12
      build/pdf.combined.js
  3. 2
      build/pdf.combined.js.map
  4. 12
      build/pdf.js
  5. 2
      build/pdf.js.map
  6. 4
      build/pdf.min.js
  7. 4
      build/pdf.worker.js
  8. 2
      build/pdf.worker.js.map
  9. 4
      lib/display/api.js
  10. 4
      lib/display/global.js
  11. 4
      lib/pdf.js
  12. 4
      lib/pdf.worker.js
  13. 110
      lib/web/pdf_thumbnail_view.js
  14. 135
      lib/web/pdf_thumbnail_viewer.js
  15. 2
      package.json

2
bower.json

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

12
build/pdf.combined.js

@ -12809,8 +12809,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}(); }();
var version, build; var version, build;
{ {
exports.version = version = '1.8.420'; exports.version = version = '1.8.423';
exports.build = build = '63b89c11'; exports.build = build = '8654635b';
} }
exports.getDocument = getDocument; exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort; exports.LoopbackPort = LoopbackPort;
@ -28147,8 +28147,8 @@ if (!_util.globalScope.PDFJS) {
} }
var PDFJS = _util.globalScope.PDFJS; var PDFJS = _util.globalScope.PDFJS;
{ {
PDFJS.version = '1.8.420'; PDFJS.version = '1.8.423';
PDFJS.build = '63b89c11'; PDFJS.build = '8654635b';
} }
PDFJS.pdfBug = false; PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) { if (PDFJS.verbosity !== undefined) {
@ -46762,8 +46762,8 @@ exports.TilingPattern = TilingPattern;
"use strict"; "use strict";
var pdfjsVersion = '1.8.420'; var pdfjsVersion = '1.8.423';
var pdfjsBuild = '63b89c11'; var pdfjsBuild = '8654635b';
var pdfjsSharedUtil = __w_pdfjs_require__(0); var pdfjsSharedUtil = __w_pdfjs_require__(0);
var pdfjsDisplayGlobal = __w_pdfjs_require__(26); var pdfjsDisplayGlobal = __w_pdfjs_require__(26);
var pdfjsDisplayAPI = __w_pdfjs_require__(10); var pdfjsDisplayAPI = __w_pdfjs_require__(10);

2
build/pdf.combined.js.map

File diff suppressed because one or more lines are too long

12
build/pdf.js

@ -3538,8 +3538,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}(); }();
var version, build; var version, build;
{ {
exports.version = version = '1.8.420'; exports.version = version = '1.8.423';
exports.build = build = '63b89c11'; exports.build = build = '8654635b';
} }
exports.getDocument = getDocument; exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort; exports.LoopbackPort = LoopbackPort;
@ -5512,8 +5512,8 @@ if (!_util.globalScope.PDFJS) {
} }
var PDFJS = _util.globalScope.PDFJS; var PDFJS = _util.globalScope.PDFJS;
{ {
PDFJS.version = '1.8.420'; PDFJS.version = '1.8.423';
PDFJS.build = '63b89c11'; PDFJS.build = '8654635b';
} }
PDFJS.pdfBug = false; PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) { if (PDFJS.verbosity !== undefined) {
@ -11052,8 +11052,8 @@ exports.TilingPattern = TilingPattern;
"use strict"; "use strict";
var pdfjsVersion = '1.8.420'; var pdfjsVersion = '1.8.423';
var pdfjsBuild = '63b89c11'; var pdfjsBuild = '8654635b';
var pdfjsSharedUtil = __w_pdfjs_require__(0); var pdfjsSharedUtil = __w_pdfjs_require__(0);
var pdfjsDisplayGlobal = __w_pdfjs_require__(9); var pdfjsDisplayGlobal = __w_pdfjs_require__(9);
var pdfjsDisplayAPI = __w_pdfjs_require__(3); var pdfjsDisplayAPI = __w_pdfjs_require__(3);

2
build/pdf.js.map

File diff suppressed because one or more lines are too long

4
build/pdf.min.js vendored

File diff suppressed because one or more lines are too long

4
build/pdf.worker.js vendored

@ -40061,8 +40061,8 @@ exports.Type1Parser = Type1Parser;
"use strict"; "use strict";
var pdfjsVersion = '1.8.420'; var pdfjsVersion = '1.8.423';
var pdfjsBuild = '63b89c11'; var pdfjsBuild = '8654635b';
var pdfjsCoreWorker = __w_pdfjs_require__(8); var pdfjsCoreWorker = __w_pdfjs_require__(8);
{ {
__w_pdfjs_require__(19); __w_pdfjs_require__(19);

2
build/pdf.worker.js.map vendored

File diff suppressed because one or more lines are too long

4
lib/display/api.js

@ -1418,8 +1418,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}(); }();
var version, build; var version, build;
{ {
exports.version = version = '1.8.420'; exports.version = version = '1.8.423';
exports.build = build = '63b89c11'; exports.build = build = '8654635b';
} }
exports.getDocument = getDocument; exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort; exports.LoopbackPort = LoopbackPort;

4
lib/display/global.js

@ -39,8 +39,8 @@ if (!_util.globalScope.PDFJS) {
} }
var PDFJS = _util.globalScope.PDFJS; var PDFJS = _util.globalScope.PDFJS;
{ {
PDFJS.version = '1.8.420'; PDFJS.version = '1.8.423';
PDFJS.build = '63b89c11'; PDFJS.build = '8654635b';
} }
PDFJS.pdfBug = false; PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) { if (PDFJS.verbosity !== undefined) {

4
lib/pdf.js

@ -14,8 +14,8 @@
*/ */
'use strict'; 'use strict';
var pdfjsVersion = '1.8.420'; var pdfjsVersion = '1.8.423';
var pdfjsBuild = '63b89c11'; var pdfjsBuild = '8654635b';
var pdfjsSharedUtil = require('./shared/util.js'); var pdfjsSharedUtil = require('./shared/util.js');
var pdfjsDisplayGlobal = require('./display/global.js'); var pdfjsDisplayGlobal = require('./display/global.js');
var pdfjsDisplayAPI = require('./display/api.js'); var pdfjsDisplayAPI = require('./display/api.js');

4
lib/pdf.worker.js vendored

@ -14,8 +14,8 @@
*/ */
'use strict'; 'use strict';
var pdfjsVersion = '1.8.420'; var pdfjsVersion = '1.8.423';
var pdfjsBuild = '63b89c11'; var pdfjsBuild = '8654635b';
var pdfjsCoreWorker = require('./core/worker.js'); var pdfjsCoreWorker = require('./core/worker.js');
{ {
require('./core/network.js'); require('./core/network.js');

110
lib/web/pdf_thumbnail_view.js

@ -19,14 +19,19 @@ Object.defineProperty(exports, "__esModule", {
}); });
exports.PDFThumbnailView = undefined; exports.PDFThumbnailView = undefined;
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _pdf = require('../pdf'); var _pdf = require('../pdf');
var _ui_utils = require('./ui_utils'); var _ui_utils = require('./ui_utils');
var _pdf_rendering_queue = require('./pdf_rendering_queue'); var _pdf_rendering_queue = require('./pdf_rendering_queue');
var THUMBNAIL_WIDTH = 98; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var MAX_NUM_SCALING_STEPS = 3;
var THUMBNAIL_CANVAS_BORDER_WIDTH = 1; var THUMBNAIL_CANVAS_BORDER_WIDTH = 1;
var THUMBNAIL_WIDTH = 98;
var TempImageFactory = function TempImageFactoryClosure() { var TempImageFactory = function TempImageFactoryClosure() {
var tempCanvasCache = null; var tempCanvasCache = null;
return { return {
@ -56,14 +61,21 @@ var TempImageFactory = function TempImageFactoryClosure() {
} }
}; };
}(); }();
var PDFThumbnailView = function PDFThumbnailViewClosure() {
function PDFThumbnailView(options) { var PDFThumbnailView = function () {
var container = options.container; function PDFThumbnailView(_ref) {
var id = options.id; var container = _ref.container,
var defaultViewport = options.defaultViewport; id = _ref.id,
var linkService = options.linkService; defaultViewport = _ref.defaultViewport,
var renderingQueue = options.renderingQueue; linkService = _ref.linkService,
var disableCanvasToImageConversion = options.disableCanvasToImageConversion || false; renderingQueue = _ref.renderingQueue,
_ref$disableCanvasToI = _ref.disableCanvasToImageConversion,
disableCanvasToImageConversion = _ref$disableCanvasToI === undefined ? false : _ref$disableCanvasToI,
_ref$l10n = _ref.l10n,
l10n = _ref$l10n === undefined ? _ui_utils.NullL10n : _ref$l10n;
_classCallCheck(this, PDFThumbnailView);
this.id = id; this.id = id;
this.renderingId = 'thumbnail' + id; this.renderingId = 'thumbnail' + id;
this.pageLabel = null; this.pageLabel = null;
@ -83,13 +95,13 @@ var PDFThumbnailView = function PDFThumbnailViewClosure() {
this.canvasWidth = THUMBNAIL_WIDTH; this.canvasWidth = THUMBNAIL_WIDTH;
this.canvasHeight = this.canvasWidth / this.pageRatio | 0; this.canvasHeight = this.canvasWidth / this.pageRatio | 0;
this.scale = this.canvasWidth / this.pageWidth; this.scale = this.canvasWidth / this.pageWidth;
this.l10n = options.l10n || _ui_utils.NullL10n; this.l10n = l10n;
var anchor = document.createElement('a'); var anchor = document.createElement('a');
anchor.href = linkService.getAnchorUrl('#page=' + id); anchor.href = linkService.getAnchorUrl('#page=' + id);
this.l10n.get('thumb_page_title', { page: id }, 'Page {{page}}').then(function (msg) { this.l10n.get('thumb_page_title', { page: id }, 'Page {{page}}').then(function (msg) {
anchor.title = msg; anchor.title = msg;
}); });
anchor.onclick = function stopNavigation() { anchor.onclick = function () {
linkService.page = id; linkService.page = id;
return false; return false;
}; };
@ -111,15 +123,19 @@ var PDFThumbnailView = function PDFThumbnailViewClosure() {
anchor.appendChild(div); anchor.appendChild(div);
container.appendChild(anchor); container.appendChild(anchor);
} }
PDFThumbnailView.prototype = {
setPdfPage: function PDFThumbnailView_setPdfPage(pdfPage) { _createClass(PDFThumbnailView, [{
key: 'setPdfPage',
value: function setPdfPage(pdfPage) {
this.pdfPage = pdfPage; this.pdfPage = pdfPage;
this.pdfPageRotate = pdfPage.rotate; this.pdfPageRotate = pdfPage.rotate;
var totalRotation = (this.rotation + this.pdfPageRotate) % 360; var totalRotation = (this.rotation + this.pdfPageRotate) % 360;
this.viewport = pdfPage.getViewport(1, totalRotation); this.viewport = pdfPage.getViewport(1, totalRotation);
this.reset(); this.reset();
}, }
reset: function PDFThumbnailView_reset() { }, {
key: 'reset',
value: function reset() {
this.cancelRendering(); this.cancelRendering();
this.pageWidth = this.viewport.width; this.pageWidth = this.viewport.width;
this.pageHeight = this.viewport.height; this.pageHeight = this.viewport.height;
@ -144,8 +160,10 @@ var PDFThumbnailView = function PDFThumbnailViewClosure() {
this.image.removeAttribute('src'); this.image.removeAttribute('src');
delete this.image; delete this.image;
} }
}, }
update: function PDFThumbnailView_update(rotation) { }, {
key: 'update',
value: function update(rotation) {
if (typeof rotation !== 'undefined') { if (typeof rotation !== 'undefined') {
this.rotation = rotation; this.rotation = rotation;
} }
@ -155,16 +173,22 @@ var PDFThumbnailView = function PDFThumbnailViewClosure() {
rotation: totalRotation rotation: totalRotation
}); });
this.reset(); this.reset();
}, }
cancelRendering: function PDFThumbnailView_cancelRendering() { }, {
key: 'cancelRendering',
value: function cancelRendering() {
if (this.renderTask) { if (this.renderTask) {
this.renderTask.cancel(); this.renderTask.cancel();
this.renderTask = null; this.renderTask = null;
} }
this.renderingState = _pdf_rendering_queue.RenderingStates.INITIAL; this.renderingState = _pdf_rendering_queue.RenderingStates.INITIAL;
this.resume = null; this.resume = null;
}, }
_getPageDrawContext: function PDFThumbnailView_getPageDrawContext(noCtxScale) { }, {
key: '_getPageDrawContext',
value: function _getPageDrawContext() {
var noCtxScale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
var canvas = document.createElement('canvas'); var canvas = document.createElement('canvas');
this.canvas = canvas; this.canvas = canvas;
canvas.mozOpaque = true; canvas.mozOpaque = true;
@ -178,8 +202,10 @@ var PDFThumbnailView = function PDFThumbnailViewClosure() {
ctx.scale(outputScale.sx, outputScale.sy); ctx.scale(outputScale.sx, outputScale.sy);
} }
return ctx; return ctx;
}, }
_convertCanvasToImage: function PDFThumbnailView_convertCanvasToImage() { }, {
key: '_convertCanvasToImage',
value: function _convertCanvasToImage() {
var _this = this; var _this = this;
if (!this.canvas) { if (!this.canvas) {
@ -215,8 +241,10 @@ var PDFThumbnailView = function PDFThumbnailViewClosure() {
this.canvas.width = 0; this.canvas.width = 0;
this.canvas.height = 0; this.canvas.height = 0;
delete this.canvas; delete this.canvas;
}, }
draw: function draw() { }, {
key: 'draw',
value: function draw() {
var _this2 = this; var _this2 = this;
if (this.renderingState !== _pdf_rendering_queue.RenderingStates.INITIAL) { if (this.renderingState !== _pdf_rendering_queue.RenderingStates.INITIAL) {
@ -266,9 +294,10 @@ var PDFThumbnailView = function PDFThumbnailViewClosure() {
finishRenderTask(error); finishRenderTask(error);
}); });
return renderCapability.promise; return renderCapability.promise;
}, }
}, {
setImage: function PDFThumbnailView_setImage(pageView) { key: 'setImage',
value: function setImage(pageView) {
if (this.renderingState !== _pdf_rendering_queue.RenderingStates.INITIAL) { if (this.renderingState !== _pdf_rendering_queue.RenderingStates.INITIAL) {
return; return;
} }
@ -287,7 +316,6 @@ var PDFThumbnailView = function PDFThumbnailViewClosure() {
this._convertCanvasToImage(); this._convertCanvasToImage();
return; return;
} }
var MAX_NUM_SCALING_STEPS = 3;
var reducedWidth = canvas.width << MAX_NUM_SCALING_STEPS; var reducedWidth = canvas.width << MAX_NUM_SCALING_STEPS;
var reducedHeight = canvas.height << MAX_NUM_SCALING_STEPS; var reducedHeight = canvas.height << MAX_NUM_SCALING_STEPS;
var reducedImage = TempImageFactory.getCanvas(reducedWidth, reducedHeight); var reducedImage = TempImageFactory.getCanvas(reducedWidth, reducedHeight);
@ -304,11 +332,10 @@ var PDFThumbnailView = function PDFThumbnailViewClosure() {
} }
ctx.drawImage(reducedImage, 0, 0, reducedWidth, reducedHeight, 0, 0, canvas.width, canvas.height); ctx.drawImage(reducedImage, 0, 0, reducedWidth, reducedHeight, 0, 0, canvas.width, canvas.height);
this._convertCanvasToImage(); this._convertCanvasToImage();
}, }
get pageId() { }, {
return this.pageLabel !== null ? this.pageLabel : this.id; key: 'setPageLabel',
}, value: function setPageLabel(label) {
setPageLabel: function PDFThumbnailView_setPageLabel(label) {
var _this3 = this; var _this3 = this;
this.pageLabel = typeof label === 'string' ? label : null; this.pageLabel = typeof label === 'string' ? label : null;
@ -326,10 +353,19 @@ var PDFThumbnailView = function PDFThumbnailViewClosure() {
} }
}); });
} }
}; }, {
PDFThumbnailView.cleanup = function () { key: 'pageId',
get: function get() {
return this.pageLabel !== null ? this.pageLabel : this.id;
}
}], [{
key: 'cleanup',
value: function cleanup() {
TempImageFactory.destroyCanvas(); TempImageFactory.destroyCanvas();
}; }
}]);
return PDFThumbnailView; return PDFThumbnailView;
}(); }();
exports.PDFThumbnailView = PDFThumbnailView; exports.PDFThumbnailView = PDFThumbnailView;

135
lib/web/pdf_thumbnail_viewer.js

@ -19,31 +19,52 @@ Object.defineProperty(exports, "__esModule", {
}); });
exports.PDFThumbnailViewer = undefined; exports.PDFThumbnailViewer = undefined;
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _ui_utils = require('./ui_utils'); var _ui_utils = require('./ui_utils');
var _pdf_thumbnail_view = require('./pdf_thumbnail_view'); var _pdf_thumbnail_view = require('./pdf_thumbnail_view');
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var THUMBNAIL_SCROLL_MARGIN = -19; var THUMBNAIL_SCROLL_MARGIN = -19;
var PDFThumbnailViewer = function PDFThumbnailViewerClosure() {
function PDFThumbnailViewer(options) { var PDFThumbnailViewer = function () {
this.container = options.container; function PDFThumbnailViewer(_ref) {
this.renderingQueue = options.renderingQueue; var container = _ref.container,
this.linkService = options.linkService; linkService = _ref.linkService,
this.l10n = options.l10n || _ui_utils.NullL10n; renderingQueue = _ref.renderingQueue,
_ref$l10n = _ref.l10n,
l10n = _ref$l10n === undefined ? _ui_utils.NullL10n : _ref$l10n;
_classCallCheck(this, PDFThumbnailViewer);
this.container = container;
this.linkService = linkService;
this.renderingQueue = renderingQueue;
this.l10n = l10n;
this.scroll = (0, _ui_utils.watchScroll)(this.container, this._scrollUpdated.bind(this)); this.scroll = (0, _ui_utils.watchScroll)(this.container, this._scrollUpdated.bind(this));
this._resetView(); this._resetView();
} }
PDFThumbnailViewer.prototype = {
_scrollUpdated: function PDFThumbnailViewer_scrollUpdated() { _createClass(PDFThumbnailViewer, [{
key: '_scrollUpdated',
value: function _scrollUpdated() {
this.renderingQueue.renderHighestPriority(); this.renderingQueue.renderHighestPriority();
}, }
getThumbnail: function PDFThumbnailViewer_getThumbnail(index) { }, {
return this.thumbnails[index]; key: 'getThumbnail',
}, value: function getThumbnail(index) {
_getVisibleThumbs: function PDFThumbnailViewer_getVisibleThumbs() { return this._thumbnails[index];
return (0, _ui_utils.getVisibleElements)(this.container, this.thumbnails); }
}, }, {
scrollThumbnailIntoView: function PDFThumbnailViewer_scrollThumbnailIntoView(page) { key: '_getVisibleThumbs',
value: function _getVisibleThumbs() {
return (0, _ui_utils.getVisibleElements)(this.container, this._thumbnails);
}
}, {
key: 'scrollThumbnailIntoView',
value: function scrollThumbnailIntoView(page) {
var selected = document.querySelector('.thumbnail.selected'); var selected = document.querySelector('.thumbnail.selected');
if (selected) { if (selected) {
selected.classList.remove('selected'); selected.classList.remove('selected');
@ -61,28 +82,24 @@ var PDFThumbnailViewer = function PDFThumbnailViewerClosure() {
(0, _ui_utils.scrollIntoView)(thumbnail, { top: THUMBNAIL_SCROLL_MARGIN }); (0, _ui_utils.scrollIntoView)(thumbnail, { top: THUMBNAIL_SCROLL_MARGIN });
} }
} }
},
get pagesRotation() {
return this._pagesRotation;
},
set pagesRotation(rotation) {
this._pagesRotation = rotation;
for (var i = 0, l = this.thumbnails.length; i < l; i++) {
var thumb = this.thumbnails[i];
thumb.update(rotation);
} }
}, }, {
cleanup: function PDFThumbnailViewer_cleanup() { key: 'cleanup',
value: function cleanup() {
_pdf_thumbnail_view.PDFThumbnailView.cleanup(); _pdf_thumbnail_view.PDFThumbnailView.cleanup();
}, }
_resetView: function PDFThumbnailViewer_resetView() { }, {
this.thumbnails = []; key: '_resetView',
value: function _resetView() {
this._thumbnails = [];
this._pageLabels = null; this._pageLabels = null;
this._pagesRotation = 0; this._pagesRotation = 0;
this._pagesRequests = []; this._pagesRequests = [];
this.container.textContent = ''; this.container.textContent = '';
}, }
setDocument: function PDFThumbnailViewer_setDocument(pdfDocument) { }, {
key: 'setDocument',
value: function setDocument(pdfDocument) {
var _this = this; var _this = this;
if (this.pdfDocument) { if (this.pdfDocument) {
@ -106,18 +123,22 @@ var PDFThumbnailViewer = function PDFThumbnailViewerClosure() {
disableCanvasToImageConversion: false, disableCanvasToImageConversion: false,
l10n: _this.l10n l10n: _this.l10n
}); });
_this.thumbnails.push(thumbnail); _this._thumbnails.push(thumbnail);
} }
}); });
},
_cancelRendering: function PDFThumbnailViewer_cancelRendering() {
for (var i = 0, ii = this.thumbnails.length; i < ii; i++) {
if (this.thumbnails[i]) {
this.thumbnails[i].cancelRendering();
} }
}, {
key: '_cancelRendering',
value: function _cancelRendering() {
for (var i = 0, ii = this._thumbnails.length; i < ii; i++) {
if (this._thumbnails[i]) {
this._thumbnails[i].cancelRendering();
} }
}, }
setPageLabels: function PDFThumbnailViewer_setPageLabels(labels) { }
}, {
key: 'setPageLabels',
value: function setPageLabels(labels) {
if (!this.pdfDocument) { if (!this.pdfDocument) {
return; return;
} }
@ -129,13 +150,14 @@ var PDFThumbnailViewer = function PDFThumbnailViewerClosure() {
} else { } else {
this._pageLabels = labels; this._pageLabels = labels;
} }
for (var i = 0, ii = this.thumbnails.length; i < ii; i++) { for (var i = 0, ii = this._thumbnails.length; i < ii; i++) {
var thumbnailView = this.thumbnails[i];
var label = this._pageLabels && this._pageLabels[i]; var label = this._pageLabels && this._pageLabels[i];
thumbnailView.setPageLabel(label); this._thumbnails[i].setPageLabel(label);
} }
}, }
_ensurePdfPageLoaded: function _ensurePdfPageLoaded(thumbView) { }, {
key: '_ensurePdfPageLoaded',
value: function _ensurePdfPageLoaded(thumbView) {
var _this2 = this; var _this2 = this;
if (thumbView.pdfPage) { if (thumbView.pdfPage) {
@ -152,12 +174,14 @@ var PDFThumbnailViewer = function PDFThumbnailViewerClosure() {
}); });
this._pagesRequests[pageNumber] = promise; this._pagesRequests[pageNumber] = promise;
return promise; return promise;
}, }
forceRendering: function forceRendering() { }, {
key: 'forceRendering',
value: function forceRendering() {
var _this3 = this; var _this3 = this;
var visibleThumbs = this._getVisibleThumbs(); var visibleThumbs = this._getVisibleThumbs();
var thumbView = this.renderingQueue.getHighestPriority(visibleThumbs, this.thumbnails, this.scroll.down); var thumbView = this.renderingQueue.getHighestPriority(visibleThumbs, this._thumbnails, this.scroll.down);
if (thumbView) { if (thumbView) {
this._ensurePdfPageLoaded(thumbView).then(function () { this._ensurePdfPageLoaded(thumbView).then(function () {
_this3.renderingQueue.renderView(thumbView); _this3.renderingQueue.renderView(thumbView);
@ -166,7 +190,20 @@ var PDFThumbnailViewer = function PDFThumbnailViewerClosure() {
} }
return false; return false;
} }
}; }, {
key: 'pagesRotation',
get: function get() {
return this._pagesRotation;
},
set: function set(rotation) {
this._pagesRotation = rotation;
for (var i = 0, l = this._thumbnails.length; i < l; i++) {
this._thumbnails[i].update(rotation);
}
}
}]);
return PDFThumbnailViewer; return PDFThumbnailViewer;
}(); }();
exports.PDFThumbnailViewer = PDFThumbnailViewer; exports.PDFThumbnailViewer = PDFThumbnailViewer;

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "pdfjs-dist", "name": "pdfjs-dist",
"version": "1.8.420", "version": "1.8.423",
"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": [

Loading…
Cancel
Save