From dd07ef9c6a8bc98b7fbe2bd0d7ae9f4bf4fef113 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Tue, 12 May 2015 08:44:42 -0500 Subject: [PATCH] Disables rAF for the printing. --- src/display/api.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/display/api.js b/src/display/api.js index 3bb9a0c19..7919cb4e2 100644 --- a/src/display/api.js +++ b/src/display/api.js @@ -740,6 +740,7 @@ var PDFPageProxy = (function PDFPageProxyClosure() { this.commonObjs, intentState.operatorList, this.pageNumber); + internalRenderTask.useRequestAnimationFrame = renderingIntent !== 'print'; if (!intentState.renderTasks) { intentState.renderTasks = []; } @@ -1555,6 +1556,7 @@ var InternalRenderTask = (function InternalRenderTaskClosure() { this.running = false; this.graphicsReadyCallback = null; this.graphicsReady = false; + this.useRequestAnimationFrame = false; this.cancelled = false; this.capability = createPromiseCapability(); this.task = new RenderTask(this); @@ -1628,7 +1630,11 @@ var InternalRenderTask = (function InternalRenderTaskClosure() { }, _scheduleNext: function InternalRenderTask__scheduleNext() { - window.requestAnimationFrame(this._nextBound); + if (this.useRequestAnimationFrame) { + window.requestAnimationFrame(this._nextBound); + } else { + Promise.resolve(undefined).then(this._nextBound); + } }, _next: function InternalRenderTask__next() {