Browse Source

PDF.js version 1.8.355 - See mozilla/pdf.js@e9cbfbccb47135c4bc930267d75935d3db15abc7

master v1.8.355
pdfjsbot 8 years ago
parent
commit
b982be863b
  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
      build/pdf.worker.min.js
  10. 4
      lib/display/api.js
  11. 4
      lib/display/global.js
  12. 4
      lib/pdf.js
  13. 4
      lib/pdf.worker.js
  14. 63
      lib/web/pdf_page_view.js
  15. 34
      lib/web/pdf_thumbnail_view.js
  16. 2
      package.json
  17. 63
      web/pdf_viewer.js
  18. 2
      web/pdf_viewer.js.map

2
bower.json

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

12
build/pdf.combined.js

@ -12822,8 +12822,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() { @@ -12822,8 +12822,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}();
var version, build;
{
exports.version = version = '1.8.353';
exports.build = build = '08f8b68f';
exports.version = version = '1.8.355';
exports.build = build = 'e9cbfbcc';
}
exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort;
@ -28229,8 +28229,8 @@ if (!_util.globalScope.PDFJS) { @@ -28229,8 +28229,8 @@ if (!_util.globalScope.PDFJS) {
}
var PDFJS = _util.globalScope.PDFJS;
{
PDFJS.version = '1.8.353';
PDFJS.build = '08f8b68f';
PDFJS.version = '1.8.355';
PDFJS.build = 'e9cbfbcc';
}
PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) {
@ -43816,8 +43816,8 @@ exports.TilingPattern = TilingPattern; @@ -43816,8 +43816,8 @@ exports.TilingPattern = TilingPattern;
"use strict";
var pdfjsVersion = '1.8.353';
var pdfjsBuild = '08f8b68f';
var pdfjsVersion = '1.8.355';
var pdfjsBuild = 'e9cbfbcc';
var pdfjsSharedUtil = __w_pdfjs_require__(0);
var pdfjsDisplayGlobal = __w_pdfjs_require__(26);
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

@ -3530,8 +3530,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() { @@ -3530,8 +3530,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}();
var version, build;
{
exports.version = version = '1.8.353';
exports.build = build = '08f8b68f';
exports.version = version = '1.8.355';
exports.build = build = 'e9cbfbcc';
}
exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort;
@ -5504,8 +5504,8 @@ if (!_util.globalScope.PDFJS) { @@ -5504,8 +5504,8 @@ if (!_util.globalScope.PDFJS) {
}
var PDFJS = _util.globalScope.PDFJS;
{
PDFJS.version = '1.8.353';
PDFJS.build = '08f8b68f';
PDFJS.version = '1.8.355';
PDFJS.build = 'e9cbfbcc';
}
PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) {
@ -8000,8 +8000,8 @@ exports.TilingPattern = TilingPattern; @@ -8000,8 +8000,8 @@ exports.TilingPattern = TilingPattern;
"use strict";
var pdfjsVersion = '1.8.353';
var pdfjsBuild = '08f8b68f';
var pdfjsVersion = '1.8.355';
var pdfjsBuild = 'e9cbfbcc';
var pdfjsSharedUtil = __w_pdfjs_require__(0);
var pdfjsDisplayGlobal = __w_pdfjs_require__(9);
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

@ -37144,8 +37144,8 @@ exports.Type1Parser = Type1Parser; @@ -37144,8 +37144,8 @@ exports.Type1Parser = Type1Parser;
"use strict";
var pdfjsVersion = '1.8.353';
var pdfjsBuild = '08f8b68f';
var pdfjsVersion = '1.8.355';
var pdfjsBuild = 'e9cbfbcc';
var pdfjsCoreWorker = __w_pdfjs_require__(8);
{
__w_pdfjs_require__(19);

2
build/pdf.worker.js.map vendored

File diff suppressed because one or more lines are too long

4
build/pdf.worker.min.js vendored

File diff suppressed because one or more lines are too long

4
lib/display/api.js

@ -1413,8 +1413,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() { @@ -1413,8 +1413,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}();
var version, build;
{
exports.version = version = '1.8.353';
exports.build = build = '08f8b68f';
exports.version = version = '1.8.355';
exports.build = build = 'e9cbfbcc';
}
exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort;

4
lib/display/global.js

@ -39,8 +39,8 @@ if (!_util.globalScope.PDFJS) { @@ -39,8 +39,8 @@ if (!_util.globalScope.PDFJS) {
}
var PDFJS = _util.globalScope.PDFJS;
{
PDFJS.version = '1.8.353';
PDFJS.build = '08f8b68f';
PDFJS.version = '1.8.355';
PDFJS.build = 'e9cbfbcc';
}
PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) {

4
lib/pdf.js

@ -14,8 +14,8 @@ @@ -14,8 +14,8 @@
*/
'use strict';
var pdfjsVersion = '1.8.353';
var pdfjsBuild = '08f8b68f';
var pdfjsVersion = '1.8.355';
var pdfjsBuild = 'e9cbfbcc';
var pdfjsSharedUtil = require('./shared/util.js');
var pdfjsDisplayGlobal = require('./display/global.js');
var pdfjsDisplayAPI = require('./display/api.js');

4
lib/pdf.worker.js vendored

@ -14,8 +14,8 @@ @@ -14,8 +14,8 @@
*/
'use strict';
var pdfjsVersion = '1.8.353';
var pdfjsBuild = '08f8b68f';
var pdfjsVersion = '1.8.355';
var pdfjsBuild = 'e9cbfbcc';
var pdfjsCoreWorker = require('./core/worker.js');
{
require('./core/network.js');

63
lib/web/pdf_page_view.js

@ -266,13 +266,14 @@ var PDFPageView = function PDFPageViewClosure() { @@ -266,13 +266,14 @@ var PDFPageView = function PDFPageViewClosure() {
getPagePoint: function PDFPageView_getPagePoint(x, y) {
return this.viewport.convertToPdfPoint(x, y);
},
draw: function PDFPageView_draw() {
draw: function draw() {
var _this = this;
if (this.renderingState !== _pdf_rendering_queue.RenderingStates.INITIAL) {
console.error('Must be in new state before drawing');
this.reset();
}
this.renderingState = _pdf_rendering_queue.RenderingStates.RUNNING;
var self = this;
var pdfPage = this.pdfPage;
var div = this.div;
var canvasWrapper = document.createElement('div');
@ -284,10 +285,9 @@ var PDFPageView = function PDFPageViewClosure() { @@ -284,10 +285,9 @@ var PDFPageView = function PDFPageViewClosure() {
} else {
div.appendChild(canvasWrapper);
}
var textLayerDiv = null;
var textLayer = null;
if (this.textLayerFactory) {
textLayerDiv = document.createElement('div');
var textLayerDiv = document.createElement('div');
textLayerDiv.className = 'textLayer';
textLayerDiv.style.width = canvasWrapper.style.width;
textLayerDiv.style.height = canvasWrapper.style.height;
@ -302,10 +302,10 @@ var PDFPageView = function PDFPageViewClosure() { @@ -302,10 +302,10 @@ var PDFPageView = function PDFPageViewClosure() {
var renderContinueCallback = null;
if (this.renderingQueue) {
renderContinueCallback = function renderContinueCallback(cont) {
if (!self.renderingQueue.isHighestPriority(self)) {
self.renderingState = _pdf_rendering_queue.RenderingStates.PAUSED;
self.resume = function resumeCallback() {
self.renderingState = _pdf_rendering_queue.RenderingStates.RUNNING;
if (!_this.renderingQueue.isHighestPriority(_this)) {
_this.renderingState = _pdf_rendering_queue.RenderingStates.PAUSED;
_this.resume = function () {
_this.renderingState = _pdf_rendering_queue.RenderingStates.RUNNING;
cont();
};
return;
@ -314,27 +314,27 @@ var PDFPageView = function PDFPageViewClosure() { @@ -314,27 +314,27 @@ var PDFPageView = function PDFPageViewClosure() {
};
}
var finishPaintTask = function finishPaintTask(error) {
if (paintTask === self.paintTask) {
self.paintTask = null;
if (paintTask === _this.paintTask) {
_this.paintTask = null;
}
if (error === 'cancelled' || error instanceof _pdfjs.RenderingCancelledException) {
self.error = null;
_this.error = null;
return Promise.resolve(undefined);
}
self.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;
if (self.loadingIconDiv) {
div.removeChild(self.loadingIconDiv);
delete self.loadingIconDiv;
_this.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;
if (_this.loadingIconDiv) {
div.removeChild(_this.loadingIconDiv);
delete _this.loadingIconDiv;
}
self._resetZoomLayer(true);
self.error = error;
self.stats = pdfPage.stats;
if (self.onAfterDraw) {
self.onAfterDraw();
_this._resetZoomLayer(true);
_this.error = error;
_this.stats = pdfPage.stats;
if (_this.onAfterDraw) {
_this.onAfterDraw();
}
self.eventBus.dispatch('pagerendered', {
source: self,
pageNumber: self.id,
_this.eventBus.dispatch('pagerendered', {
source: _this,
pageNumber: _this.id,
cssTransform: false
});
if (error) {
@ -438,28 +438,28 @@ var PDFPageView = function PDFPageViewClosure() { @@ -438,28 +438,28 @@ var PDFPageView = function PDFPageViewClosure() {
cont();
}
};
renderTask.promise.then(function pdfPageRenderCallback() {
renderTask.promise.then(function () {
showCanvas();
renderCapability.resolve(undefined);
}, function pdfPageRenderError(error) {
}, function (error) {
showCanvas();
renderCapability.reject(error);
});
return result;
},
paintOnSvg: function paintOnSvg(wrapper) {
var _this2 = this;
paintOnSvg: function PDFPageView_paintOnSvg(wrapper) {
var cancelled = false;
var ensureNotCancelled = function ensureNotCancelled() {
if (cancelled) {
if (_pdfjs.PDFJS.pdfjsNext) {
throw new _pdfjs.RenderingCancelledException('Rendering cancelled, page ' + self.id, 'svg');
throw new _pdfjs.RenderingCancelledException('Rendering cancelled, page ' + _this2.id, 'svg');
} else {
throw 'cancelled';
}
}
};
var self = this;
var pdfPage = this.pdfPage;
var actualSizeViewport = this.viewport.clone({ scale: _ui_utils.CSS_UNITS });
var promise = pdfPage.getOperatorList().then(function (opList) {
@ -467,11 +467,11 @@ var PDFPageView = function PDFPageViewClosure() { @@ -467,11 +467,11 @@ var PDFPageView = function PDFPageViewClosure() {
var svgGfx = new _pdfjs.SVGGraphics(pdfPage.commonObjs, pdfPage.objs);
return svgGfx.getSVG(opList, actualSizeViewport).then(function (svg) {
ensureNotCancelled();
self.svg = svg;
self.paintedViewportMap.set(svg, actualSizeViewport);
_this2.svg = svg;
_this2.paintedViewportMap.set(svg, actualSizeViewport);
svg.style.width = wrapper.style.width;
svg.style.height = wrapper.style.height;
self.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;
_this2.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;
wrapper.appendChild(svg);
});
});
@ -485,6 +485,7 @@ var PDFPageView = function PDFPageViewClosure() { @@ -485,6 +485,7 @@ var PDFPageView = function PDFPageViewClosure() {
}
};
},
setPageLabel: function PDFView_setPageLabel(label) {
this.pageLabel = typeof label === 'string' ? label : null;
if (this.pageLabel !== null) {

34
lib/web/pdf_thumbnail_view.js

@ -195,37 +195,38 @@ var PDFThumbnailView = function PDFThumbnailViewClosure() { @@ -195,37 +195,38 @@ var PDFThumbnailView = function PDFThumbnailViewClosure() {
this.canvas.height = 0;
delete this.canvas;
},
draw: function PDFThumbnailView_draw() {
draw: function draw() {
var _this = this;
if (this.renderingState !== _pdf_rendering_queue.RenderingStates.INITIAL) {
console.error('Must be in new state before drawing');
return Promise.resolve(undefined);
}
this.renderingState = _pdf_rendering_queue.RenderingStates.RUNNING;
var renderCapability = (0, _pdfjs.createPromiseCapability)();
var self = this;
function thumbnailDrawCallback(error) {
if (renderTask === self.renderTask) {
self.renderTask = null;
var finishRenderTask = function finishRenderTask(error) {
if (renderTask === _this.renderTask) {
_this.renderTask = null;
}
if (error === 'cancelled' || error instanceof _pdfjs.RenderingCancelledException) {
renderCapability.resolve(undefined);
return;
}
self.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;
self._convertCanvasToImage();
_this.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;
_this._convertCanvasToImage();
if (!error) {
renderCapability.resolve(undefined);
} else {
renderCapability.reject(error);
}
}
};
var ctx = this._getPageDrawContext();
var drawViewport = this.viewport.clone({ scale: this.scale });
var renderContinueCallback = function renderContinueCallback(cont) {
if (!self.renderingQueue.isHighestPriority(self)) {
self.renderingState = _pdf_rendering_queue.RenderingStates.PAUSED;
self.resume = function resumeCallback() {
self.renderingState = _pdf_rendering_queue.RenderingStates.RUNNING;
if (!_this.renderingQueue.isHighestPriority(_this)) {
_this.renderingState = _pdf_rendering_queue.RenderingStates.PAUSED;
_this.resume = function () {
_this.renderingState = _pdf_rendering_queue.RenderingStates.RUNNING;
cont();
};
return;
@ -238,13 +239,14 @@ var PDFThumbnailView = function PDFThumbnailViewClosure() { @@ -238,13 +239,14 @@ var PDFThumbnailView = function PDFThumbnailViewClosure() {
};
var renderTask = this.renderTask = this.pdfPage.render(renderContext);
renderTask.onContinue = renderContinueCallback;
renderTask.promise.then(function pdfPageRenderCallback() {
thumbnailDrawCallback(null);
}, function pdfPageRenderError(error) {
thumbnailDrawCallback(error);
renderTask.promise.then(function () {
finishRenderTask(null);
}, function (error) {
finishRenderTask(error);
});
return renderCapability.promise;
},
setImage: function PDFThumbnailView_setImage(pageView) {
if (this.renderingState !== _pdf_rendering_queue.RenderingStates.INITIAL) {
return;

2
package.json

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

63
web/pdf_viewer.js

@ -1362,13 +1362,14 @@ var PDFPageView = function PDFPageViewClosure() { @@ -1362,13 +1362,14 @@ var PDFPageView = function PDFPageViewClosure() {
getPagePoint: function PDFPageView_getPagePoint(x, y) {
return this.viewport.convertToPdfPoint(x, y);
},
draw: function PDFPageView_draw() {
draw: function draw() {
var _this = this;
if (this.renderingState !== _pdf_rendering_queue.RenderingStates.INITIAL) {
console.error('Must be in new state before drawing');
this.reset();
}
this.renderingState = _pdf_rendering_queue.RenderingStates.RUNNING;
var self = this;
var pdfPage = this.pdfPage;
var div = this.div;
var canvasWrapper = document.createElement('div');
@ -1380,10 +1381,9 @@ var PDFPageView = function PDFPageViewClosure() { @@ -1380,10 +1381,9 @@ var PDFPageView = function PDFPageViewClosure() {
} else {
div.appendChild(canvasWrapper);
}
var textLayerDiv = null;
var textLayer = null;
if (this.textLayerFactory) {
textLayerDiv = document.createElement('div');
var textLayerDiv = document.createElement('div');
textLayerDiv.className = 'textLayer';
textLayerDiv.style.width = canvasWrapper.style.width;
textLayerDiv.style.height = canvasWrapper.style.height;
@ -1398,10 +1398,10 @@ var PDFPageView = function PDFPageViewClosure() { @@ -1398,10 +1398,10 @@ var PDFPageView = function PDFPageViewClosure() {
var renderContinueCallback = null;
if (this.renderingQueue) {
renderContinueCallback = function renderContinueCallback(cont) {
if (!self.renderingQueue.isHighestPriority(self)) {
self.renderingState = _pdf_rendering_queue.RenderingStates.PAUSED;
self.resume = function resumeCallback() {
self.renderingState = _pdf_rendering_queue.RenderingStates.RUNNING;
if (!_this.renderingQueue.isHighestPriority(_this)) {
_this.renderingState = _pdf_rendering_queue.RenderingStates.PAUSED;
_this.resume = function () {
_this.renderingState = _pdf_rendering_queue.RenderingStates.RUNNING;
cont();
};
return;
@ -1410,27 +1410,27 @@ var PDFPageView = function PDFPageViewClosure() { @@ -1410,27 +1410,27 @@ var PDFPageView = function PDFPageViewClosure() {
};
}
var finishPaintTask = function finishPaintTask(error) {
if (paintTask === self.paintTask) {
self.paintTask = null;
if (paintTask === _this.paintTask) {
_this.paintTask = null;
}
if (error === 'cancelled' || error instanceof _pdfjs.RenderingCancelledException) {
self.error = null;
_this.error = null;
return Promise.resolve(undefined);
}
self.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;
if (self.loadingIconDiv) {
div.removeChild(self.loadingIconDiv);
delete self.loadingIconDiv;
_this.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;
if (_this.loadingIconDiv) {
div.removeChild(_this.loadingIconDiv);
delete _this.loadingIconDiv;
}
self._resetZoomLayer(true);
self.error = error;
self.stats = pdfPage.stats;
if (self.onAfterDraw) {
self.onAfterDraw();
_this._resetZoomLayer(true);
_this.error = error;
_this.stats = pdfPage.stats;
if (_this.onAfterDraw) {
_this.onAfterDraw();
}
self.eventBus.dispatch('pagerendered', {
source: self,
pageNumber: self.id,
_this.eventBus.dispatch('pagerendered', {
source: _this,
pageNumber: _this.id,
cssTransform: false
});
if (error) {
@ -1534,28 +1534,28 @@ var PDFPageView = function PDFPageViewClosure() { @@ -1534,28 +1534,28 @@ var PDFPageView = function PDFPageViewClosure() {
cont();
}
};
renderTask.promise.then(function pdfPageRenderCallback() {
renderTask.promise.then(function () {
showCanvas();
renderCapability.resolve(undefined);
}, function pdfPageRenderError(error) {
}, function (error) {
showCanvas();
renderCapability.reject(error);
});
return result;
},
paintOnSvg: function paintOnSvg(wrapper) {
var _this2 = this;
paintOnSvg: function PDFPageView_paintOnSvg(wrapper) {
var cancelled = false;
var ensureNotCancelled = function ensureNotCancelled() {
if (cancelled) {
if (_pdfjs.PDFJS.pdfjsNext) {
throw new _pdfjs.RenderingCancelledException('Rendering cancelled, page ' + self.id, 'svg');
throw new _pdfjs.RenderingCancelledException('Rendering cancelled, page ' + _this2.id, 'svg');
} else {
throw 'cancelled';
}
}
};
var self = this;
var pdfPage = this.pdfPage;
var actualSizeViewport = this.viewport.clone({ scale: _ui_utils.CSS_UNITS });
var promise = pdfPage.getOperatorList().then(function (opList) {
@ -1563,11 +1563,11 @@ var PDFPageView = function PDFPageViewClosure() { @@ -1563,11 +1563,11 @@ var PDFPageView = function PDFPageViewClosure() {
var svgGfx = new _pdfjs.SVGGraphics(pdfPage.commonObjs, pdfPage.objs);
return svgGfx.getSVG(opList, actualSizeViewport).then(function (svg) {
ensureNotCancelled();
self.svg = svg;
self.paintedViewportMap.set(svg, actualSizeViewport);
_this2.svg = svg;
_this2.paintedViewportMap.set(svg, actualSizeViewport);
svg.style.width = wrapper.style.width;
svg.style.height = wrapper.style.height;
self.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;
_this2.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;
wrapper.appendChild(svg);
});
});
@ -1581,6 +1581,7 @@ var PDFPageView = function PDFPageViewClosure() { @@ -1581,6 +1581,7 @@ var PDFPageView = function PDFPageViewClosure() {
}
};
},
setPageLabel: function PDFView_setPageLabel(label) {
this.pageLabel = typeof label === 'string' ? label : null;
if (this.pageLabel !== null) {

2
web/pdf_viewer.js.map

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save