Browse Source

PDF.js version 1.8.446 - See mozilla/pdf.js@e5ac64f81fadc96099e9e95c9bc401f69502d501

master v1.8.446
pdfjsbot 8 years ago
parent
commit
cf092b2205
  1. 2
      bower.json
  2. 28
      build/pdf.combined.js
  3. 2
      build/pdf.combined.js.map
  4. 28
      build/pdf.js
  5. 2
      build/pdf.js.map
  6. 16
      build/pdf.min.js
  7. 4
      build/pdf.worker.js
  8. 2
      build/pdf.worker.js.map
  9. 20
      lib/display/api.js
  10. 4
      lib/display/global.js
  11. 4
      lib/pdf.js
  12. 4
      lib/pdf.worker.js
  13. 20
      lib/test/unit/api_spec.js
  14. 2
      package.json

2
bower.json

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

28
build/pdf.combined.js

@ -12168,7 +12168,7 @@ var PDFPageProxy = function PDFPageProxyClosure() { @@ -12168,7 +12168,7 @@ var PDFPageProxy = function PDFPageProxyClosure() {
stats.time('Rendering');
internalRenderTask.initializeGraphics(transparency);
internalRenderTask.operatorListChanged();
}, complete);
}).catch(complete);
return renderTask;
},
getOperatorList: function PDFPageProxy_getOperatorList() {
@ -12945,6 +12945,7 @@ var RenderTask = function RenderTaskClosure() { @@ -12945,6 +12945,7 @@ var RenderTask = function RenderTaskClosure() {
return RenderTask;
}();
var InternalRenderTask = function InternalRenderTaskClosure() {
var canvasInRendering = new WeakMap();
function InternalRenderTask(callback, params, objs, commonObjs, operatorList, pageNumber, canvasFactory) {
this.callback = callback;
this.params = params;
@ -12964,9 +12965,16 @@ var InternalRenderTask = function InternalRenderTaskClosure() { @@ -12964,9 +12965,16 @@ var InternalRenderTask = function InternalRenderTaskClosure() {
this._continueBound = this._continue.bind(this);
this._scheduleNextBound = this._scheduleNext.bind(this);
this._nextBound = this._next.bind(this);
this._canvas = params.canvasContext.canvas;
}
InternalRenderTask.prototype = {
initializeGraphics: function InternalRenderTask_initializeGraphics(transparency) {
if (this._canvas) {
if (canvasInRendering.has(this._canvas)) {
throw new Error('Cannot use the same canvas during multiple render() operations. ' + 'Use different canvas or ensure previous operations were ' + 'cancelled or completed.');
}
canvasInRendering.set(this._canvas, this);
}
if (this.cancelled) {
return;
}
@ -12992,6 +13000,9 @@ var InternalRenderTask = function InternalRenderTaskClosure() { @@ -12992,6 +13000,9 @@ var InternalRenderTask = function InternalRenderTaskClosure() {
cancel: function InternalRenderTask_cancel() {
this.running = false;
this.cancelled = true;
if (this._canvas) {
canvasInRendering.delete(this._canvas);
}
if ((0, _dom_utils.getDefaultSetting)('pdfjsNext')) {
this.callback(new _dom_utils.RenderingCancelledException('Rendering cancelled, page ' + this.pageNumber, 'canvas'));
} else {
@ -13040,6 +13051,9 @@ var InternalRenderTask = function InternalRenderTaskClosure() { @@ -13040,6 +13051,9 @@ var InternalRenderTask = function InternalRenderTaskClosure() {
this.running = false;
if (this.operatorList.lastChunk) {
this.gfx.endDrawing();
if (this._canvas) {
canvasInRendering.delete(this._canvas);
}
this.callback();
}
}
@ -13063,8 +13077,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() { @@ -13063,8 +13077,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}();
var version, build;
{
exports.version = version = '1.8.444';
exports.build = build = 'c26e4972';
exports.version = version = '1.8.446';
exports.build = build = 'e5ac64f8';
}
exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort;
@ -28413,8 +28427,8 @@ if (!_util.globalScope.PDFJS) { @@ -28413,8 +28427,8 @@ if (!_util.globalScope.PDFJS) {
}
var PDFJS = _util.globalScope.PDFJS;
{
PDFJS.version = '1.8.444';
PDFJS.build = 'c26e4972';
PDFJS.version = '1.8.446';
PDFJS.build = 'e5ac64f8';
}
PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) {
@ -47031,8 +47045,8 @@ exports.TilingPattern = TilingPattern; @@ -47031,8 +47045,8 @@ exports.TilingPattern = TilingPattern;
"use strict";
var pdfjsVersion = '1.8.444';
var pdfjsBuild = 'c26e4972';
var pdfjsVersion = '1.8.446';
var pdfjsBuild = 'e5ac64f8';
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

28
build/pdf.js

@ -2812,7 +2812,7 @@ var PDFPageProxy = function PDFPageProxyClosure() { @@ -2812,7 +2812,7 @@ var PDFPageProxy = function PDFPageProxyClosure() {
stats.time('Rendering');
internalRenderTask.initializeGraphics(transparency);
internalRenderTask.operatorListChanged();
}, complete);
}).catch(complete);
return renderTask;
},
getOperatorList: function PDFPageProxy_getOperatorList() {
@ -3674,6 +3674,7 @@ var RenderTask = function RenderTaskClosure() { @@ -3674,6 +3674,7 @@ var RenderTask = function RenderTaskClosure() {
return RenderTask;
}();
var InternalRenderTask = function InternalRenderTaskClosure() {
var canvasInRendering = new WeakMap();
function InternalRenderTask(callback, params, objs, commonObjs, operatorList, pageNumber, canvasFactory) {
this.callback = callback;
this.params = params;
@ -3693,9 +3694,16 @@ var InternalRenderTask = function InternalRenderTaskClosure() { @@ -3693,9 +3694,16 @@ var InternalRenderTask = function InternalRenderTaskClosure() {
this._continueBound = this._continue.bind(this);
this._scheduleNextBound = this._scheduleNext.bind(this);
this._nextBound = this._next.bind(this);
this._canvas = params.canvasContext.canvas;
}
InternalRenderTask.prototype = {
initializeGraphics: function InternalRenderTask_initializeGraphics(transparency) {
if (this._canvas) {
if (canvasInRendering.has(this._canvas)) {
throw new Error('Cannot use the same canvas during multiple render() operations. ' + 'Use different canvas or ensure previous operations were ' + 'cancelled or completed.');
}
canvasInRendering.set(this._canvas, this);
}
if (this.cancelled) {
return;
}
@ -3721,6 +3729,9 @@ var InternalRenderTask = function InternalRenderTaskClosure() { @@ -3721,6 +3729,9 @@ var InternalRenderTask = function InternalRenderTaskClosure() {
cancel: function InternalRenderTask_cancel() {
this.running = false;
this.cancelled = true;
if (this._canvas) {
canvasInRendering.delete(this._canvas);
}
if ((0, _dom_utils.getDefaultSetting)('pdfjsNext')) {
this.callback(new _dom_utils.RenderingCancelledException('Rendering cancelled, page ' + this.pageNumber, 'canvas'));
} else {
@ -3769,6 +3780,9 @@ var InternalRenderTask = function InternalRenderTaskClosure() { @@ -3769,6 +3780,9 @@ var InternalRenderTask = function InternalRenderTaskClosure() {
this.running = false;
if (this.operatorList.lastChunk) {
this.gfx.endDrawing();
if (this._canvas) {
canvasInRendering.delete(this._canvas);
}
this.callback();
}
}
@ -3792,8 +3806,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() { @@ -3792,8 +3806,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}();
var version, build;
{
exports.version = version = '1.8.444';
exports.build = build = 'c26e4972';
exports.version = version = '1.8.446';
exports.build = build = 'e5ac64f8';
}
exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort;
@ -5766,8 +5780,8 @@ if (!_util.globalScope.PDFJS) { @@ -5766,8 +5780,8 @@ if (!_util.globalScope.PDFJS) {
}
var PDFJS = _util.globalScope.PDFJS;
{
PDFJS.version = '1.8.444';
PDFJS.build = 'c26e4972';
PDFJS.version = '1.8.446';
PDFJS.build = 'e5ac64f8';
}
PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) {
@ -11306,8 +11320,8 @@ exports.TilingPattern = TilingPattern; @@ -11306,8 +11320,8 @@ exports.TilingPattern = TilingPattern;
"use strict";
var pdfjsVersion = '1.8.444';
var pdfjsBuild = 'c26e4972';
var pdfjsVersion = '1.8.446';
var pdfjsBuild = 'e5ac64f8';
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

16
build/pdf.min.js vendored

File diff suppressed because one or more lines are too long

4
build/pdf.worker.js vendored

@ -40319,8 +40319,8 @@ exports.Type1Parser = Type1Parser; @@ -40319,8 +40319,8 @@ exports.Type1Parser = Type1Parser;
"use strict";
var pdfjsVersion = '1.8.444';
var pdfjsBuild = 'c26e4972';
var pdfjsVersion = '1.8.446';
var pdfjsBuild = 'e5ac64f8';
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

20
lib/display/api.js

@ -449,7 +449,7 @@ var PDFPageProxy = function PDFPageProxyClosure() { @@ -449,7 +449,7 @@ var PDFPageProxy = function PDFPageProxyClosure() {
stats.time('Rendering');
internalRenderTask.initializeGraphics(transparency);
internalRenderTask.operatorListChanged();
}, complete);
}).catch(complete);
return renderTask;
},
getOperatorList: function PDFPageProxy_getOperatorList() {
@ -1311,6 +1311,7 @@ var RenderTask = function RenderTaskClosure() { @@ -1311,6 +1311,7 @@ var RenderTask = function RenderTaskClosure() {
return RenderTask;
}();
var InternalRenderTask = function InternalRenderTaskClosure() {
var canvasInRendering = new WeakMap();
function InternalRenderTask(callback, params, objs, commonObjs, operatorList, pageNumber, canvasFactory) {
this.callback = callback;
this.params = params;
@ -1330,9 +1331,16 @@ var InternalRenderTask = function InternalRenderTaskClosure() { @@ -1330,9 +1331,16 @@ var InternalRenderTask = function InternalRenderTaskClosure() {
this._continueBound = this._continue.bind(this);
this._scheduleNextBound = this._scheduleNext.bind(this);
this._nextBound = this._next.bind(this);
this._canvas = params.canvasContext.canvas;
}
InternalRenderTask.prototype = {
initializeGraphics: function InternalRenderTask_initializeGraphics(transparency) {
if (this._canvas) {
if (canvasInRendering.has(this._canvas)) {
throw new Error('Cannot use the same canvas during multiple render() operations. ' + 'Use different canvas or ensure previous operations were ' + 'cancelled or completed.');
}
canvasInRendering.set(this._canvas, this);
}
if (this.cancelled) {
return;
}
@ -1358,6 +1366,9 @@ var InternalRenderTask = function InternalRenderTaskClosure() { @@ -1358,6 +1366,9 @@ var InternalRenderTask = function InternalRenderTaskClosure() {
cancel: function InternalRenderTask_cancel() {
this.running = false;
this.cancelled = true;
if (this._canvas) {
canvasInRendering.delete(this._canvas);
}
if ((0, _dom_utils.getDefaultSetting)('pdfjsNext')) {
this.callback(new _dom_utils.RenderingCancelledException('Rendering cancelled, page ' + this.pageNumber, 'canvas'));
} else {
@ -1406,6 +1417,9 @@ var InternalRenderTask = function InternalRenderTaskClosure() { @@ -1406,6 +1417,9 @@ var InternalRenderTask = function InternalRenderTaskClosure() {
this.running = false;
if (this.operatorList.lastChunk) {
this.gfx.endDrawing();
if (this._canvas) {
canvasInRendering.delete(this._canvas);
}
this.callback();
}
}
@ -1429,8 +1443,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() { @@ -1429,8 +1443,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}();
var version, build;
{
exports.version = version = '1.8.444';
exports.build = build = 'c26e4972';
exports.version = version = '1.8.446';
exports.build = build = 'e5ac64f8';
}
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.444';
PDFJS.build = 'c26e4972';
PDFJS.version = '1.8.446';
PDFJS.build = 'e5ac64f8';
}
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.444';
var pdfjsBuild = 'c26e4972';
var pdfjsVersion = '1.8.446';
var pdfjsBuild = 'e5ac64f8';
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.444';
var pdfjsBuild = 'c26e4972';
var pdfjsVersion = '1.8.446';
var pdfjsBuild = 'e5ac64f8';
var pdfjsCoreWorker = require('./core/worker.js');
{
require('./core/network.js');

20
lib/test/unit/api_spec.js

@ -880,6 +880,26 @@ describe('api', function () { @@ -880,6 +880,26 @@ describe('api', function () {
done();
});
});
it('multiple render() on the same canvas', function (done) {
if ((0, _util.isNodeJS)()) {
pending('TODO: Support Canvas testing in Node.js.');
}
var viewport = page.getViewport(1);
var canvasAndCtx = CanvasFactory.create(viewport.width, viewport.height);
var renderTask1 = page.render({
canvasContext: canvasAndCtx.context,
viewport: viewport
});
var renderTask2 = page.render({
canvasContext: canvasAndCtx.context,
viewport: viewport
});
Promise.all([renderTask1.promise, renderTask2.promise.then(function () {
done.fail('shall fail rendering');
}, function (reason) {
expect(/multiple render\(\)/.test(reason.message)).toEqual(true);
})]).then(done);
});
});
describe('Multiple PDFJS instances', function () {
if ((0, _util.isNodeJS)()) {

2
package.json

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

Loading…
Cancel
Save