diff --git a/bower.json b/bower.json index 06c059647..2f3f5fa5a 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.1.101", + "version": "1.1.103", "main": [ "build/pdf.js", "build/pdf.worker.js" diff --git a/build/pdf.combined.js b/build/pdf.combined.js index 92c067142..706712b3a 100644 --- a/build/pdf.combined.js +++ b/build/pdf.combined.js @@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.1.101'; -PDFJS.build = '4824baf'; +PDFJS.version = '1.1.103'; +PDFJS.build = '6159da0'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -3287,11 +3287,8 @@ function createScratchCanvas(width, height) { } function addContextCurrentTransform(ctx) { - // If the context doesn't expose a `mozCurrentTransform`, add a JS based on. + // If the context doesn't expose a `mozCurrentTransform`, add a JS based one. if (!ctx.mozCurrentTransform) { - // Store the original context - ctx._scaleX = ctx._scaleX || 1.0; - ctx._scaleY = ctx._scaleY || 1.0; ctx._originalSave = ctx.save; ctx._originalRestore = ctx.restore; ctx._originalRotate = ctx.rotate; @@ -3300,7 +3297,7 @@ function addContextCurrentTransform(ctx) { ctx._originalTransform = ctx.transform; ctx._originalSetTransform = ctx.setTransform; - ctx._transformMatrix = [ctx._scaleX, 0, 0, ctx._scaleY, 0, 0]; + ctx._transformMatrix = ctx._transformMatrix || [1, 0, 0, 1, 0, 0]; ctx._transformStack = []; Object.defineProperty(ctx, 'mozCurrentTransform', { @@ -3676,6 +3673,8 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { this.smaskCounter = 0; this.tempSMask = null; if (canvasCtx) { + // NOTE: if mozCurrentTransform is polyfilled, then the current state of + // the transformation must already be set in canvasCtx._transformMatrix. addContextCurrentTransform(canvasCtx); } this.cachedGetSinglePixelWidth = null; diff --git a/build/pdf.js b/build/pdf.js index a2efbc42a..a363b79b3 100644 --- a/build/pdf.js +++ b/build/pdf.js @@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.1.101'; -PDFJS.build = '4824baf'; +PDFJS.version = '1.1.103'; +PDFJS.build = '6159da0'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -3331,11 +3331,8 @@ function createScratchCanvas(width, height) { } function addContextCurrentTransform(ctx) { - // If the context doesn't expose a `mozCurrentTransform`, add a JS based on. + // If the context doesn't expose a `mozCurrentTransform`, add a JS based one. if (!ctx.mozCurrentTransform) { - // Store the original context - ctx._scaleX = ctx._scaleX || 1.0; - ctx._scaleY = ctx._scaleY || 1.0; ctx._originalSave = ctx.save; ctx._originalRestore = ctx.restore; ctx._originalRotate = ctx.rotate; @@ -3344,7 +3341,7 @@ function addContextCurrentTransform(ctx) { ctx._originalTransform = ctx.transform; ctx._originalSetTransform = ctx.setTransform; - ctx._transformMatrix = [ctx._scaleX, 0, 0, ctx._scaleY, 0, 0]; + ctx._transformMatrix = ctx._transformMatrix || [1, 0, 0, 1, 0, 0]; ctx._transformStack = []; Object.defineProperty(ctx, 'mozCurrentTransform', { @@ -3720,6 +3717,8 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { this.smaskCounter = 0; this.tempSMask = null; if (canvasCtx) { + // NOTE: if mozCurrentTransform is polyfilled, then the current state of + // the transformation must already be set in canvasCtx._transformMatrix. addContextCurrentTransform(canvasCtx); } this.cachedGetSinglePixelWidth = null; diff --git a/build/pdf.worker.js b/build/pdf.worker.js index 6ba3ebcc1..0cb0d67e3 100644 --- a/build/pdf.worker.js +++ b/build/pdf.worker.js @@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.1.101'; -PDFJS.build = '4824baf'; +PDFJS.version = '1.1.103'; +PDFJS.build = '6159da0'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it diff --git a/package.json b/package.json index 6c2fb778d..9ad57e517 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.1.101", + "version": "1.1.103", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [ "Mozilla", diff --git a/web/pdf_viewer.js b/web/pdf_viewer.js index 7a219cdab..724d7442e 100644 --- a/web/pdf_viewer.js +++ b/web/pdf_viewer.js @@ -923,10 +923,9 @@ var PDFPageView = (function PDFPageViewClosure() { } this.textLayer = textLayer; - // TODO(mack): use data attributes to store these - ctx._scaleX = outputScale.sx; - ctx._scaleY = outputScale.sy; if (outputScale.scaled) { + // Used by the mozCurrentTransform polyfill in src/display/canvas.js. + ctx._transformMatrix = [outputScale.sx, 0, 0, outputScale.sy, 0, 0]; ctx.scale(outputScale.sx, outputScale.sy); } @@ -1068,6 +1067,9 @@ var PDFPageView = (function PDFPageViewClosure() { ctx.fillStyle = 'rgb(255, 255, 255)'; ctx.fillRect(0, 0, canvas.width, canvas.height); ctx.restore(); + // Used by the mozCurrentTransform polyfill in src/display/canvas.js. + ctx._transformMatrix = + [PRINT_OUTPUT_SCALE, 0, 0, PRINT_OUTPUT_SCALE, 0, 0]; ctx.scale(PRINT_OUTPUT_SCALE, PRINT_OUTPUT_SCALE); var renderContext = {