From cfd5a64df575ff0739208f60dd76aaf72efe837d Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Thu, 3 Sep 2015 17:35:32 +0200 Subject: [PATCH] Ensure that the clipping path is reset when the state is restored (issue 6413) According to the specification, see `NOTE 2` in http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf#G7.3882161, it appears that we should ensure that the clipping path is reset when the restore (`Q`) operator is encountered. Fixes 6413. --- src/display/canvas.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/display/canvas.js b/src/display/canvas.js index 8e8deda9b..033068719 100644 --- a/src/display/canvas.js +++ b/src/display/canvas.js @@ -970,6 +970,9 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { this.current = this.stateStack.pop(); this.ctx.restore(); + // Ensure that the clipping path is reset (fixes issue6413.pdf). + this.pendingClip = null; + this.cachedGetSinglePixelWidth = null; } },