Browse Source

PDF.js version 1.1.103

master v1.1.103
Pdf Bot 10 years ago
parent
commit
8a8807dd4e
  1. 2
      bower.json
  2. 13
      build/pdf.combined.js
  3. 13
      build/pdf.js
  4. 4
      build/pdf.worker.js
  5. 2
      package.json
  6. 8
      web/pdf_viewer.js

2
bower.json

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

13
build/pdf.combined.js

@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
(typeof window !== 'undefined' ? window : this).PDFJS = {}; (typeof window !== 'undefined' ? window : this).PDFJS = {};
} }
PDFJS.version = '1.1.101'; PDFJS.version = '1.1.103';
PDFJS.build = '4824baf'; PDFJS.build = '6159da0';
(function pdfjsWrapper() { (function pdfjsWrapper() {
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
@ -3287,11 +3287,8 @@ function createScratchCanvas(width, height) {
} }
function addContextCurrentTransform(ctx) { 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) { if (!ctx.mozCurrentTransform) {
// Store the original context
ctx._scaleX = ctx._scaleX || 1.0;
ctx._scaleY = ctx._scaleY || 1.0;
ctx._originalSave = ctx.save; ctx._originalSave = ctx.save;
ctx._originalRestore = ctx.restore; ctx._originalRestore = ctx.restore;
ctx._originalRotate = ctx.rotate; ctx._originalRotate = ctx.rotate;
@ -3300,7 +3297,7 @@ function addContextCurrentTransform(ctx) {
ctx._originalTransform = ctx.transform; ctx._originalTransform = ctx.transform;
ctx._originalSetTransform = ctx.setTransform; 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 = []; ctx._transformStack = [];
Object.defineProperty(ctx, 'mozCurrentTransform', { Object.defineProperty(ctx, 'mozCurrentTransform', {
@ -3676,6 +3673,8 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
this.smaskCounter = 0; this.smaskCounter = 0;
this.tempSMask = null; this.tempSMask = null;
if (canvasCtx) { if (canvasCtx) {
// NOTE: if mozCurrentTransform is polyfilled, then the current state of
// the transformation must already be set in canvasCtx._transformMatrix.
addContextCurrentTransform(canvasCtx); addContextCurrentTransform(canvasCtx);
} }
this.cachedGetSinglePixelWidth = null; this.cachedGetSinglePixelWidth = null;

13
build/pdf.js

@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
(typeof window !== 'undefined' ? window : this).PDFJS = {}; (typeof window !== 'undefined' ? window : this).PDFJS = {};
} }
PDFJS.version = '1.1.101'; PDFJS.version = '1.1.103';
PDFJS.build = '4824baf'; PDFJS.build = '6159da0';
(function pdfjsWrapper() { (function pdfjsWrapper() {
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
@ -3331,11 +3331,8 @@ function createScratchCanvas(width, height) {
} }
function addContextCurrentTransform(ctx) { 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) { if (!ctx.mozCurrentTransform) {
// Store the original context
ctx._scaleX = ctx._scaleX || 1.0;
ctx._scaleY = ctx._scaleY || 1.0;
ctx._originalSave = ctx.save; ctx._originalSave = ctx.save;
ctx._originalRestore = ctx.restore; ctx._originalRestore = ctx.restore;
ctx._originalRotate = ctx.rotate; ctx._originalRotate = ctx.rotate;
@ -3344,7 +3341,7 @@ function addContextCurrentTransform(ctx) {
ctx._originalTransform = ctx.transform; ctx._originalTransform = ctx.transform;
ctx._originalSetTransform = ctx.setTransform; 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 = []; ctx._transformStack = [];
Object.defineProperty(ctx, 'mozCurrentTransform', { Object.defineProperty(ctx, 'mozCurrentTransform', {
@ -3720,6 +3717,8 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
this.smaskCounter = 0; this.smaskCounter = 0;
this.tempSMask = null; this.tempSMask = null;
if (canvasCtx) { if (canvasCtx) {
// NOTE: if mozCurrentTransform is polyfilled, then the current state of
// the transformation must already be set in canvasCtx._transformMatrix.
addContextCurrentTransform(canvasCtx); addContextCurrentTransform(canvasCtx);
} }
this.cachedGetSinglePixelWidth = null; this.cachedGetSinglePixelWidth = null;

4
build/pdf.worker.js vendored

@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
(typeof window !== 'undefined' ? window : this).PDFJS = {}; (typeof window !== 'undefined' ? window : this).PDFJS = {};
} }
PDFJS.version = '1.1.101'; PDFJS.version = '1.1.103';
PDFJS.build = '4824baf'; PDFJS.build = '6159da0';
(function pdfjsWrapper() { (function pdfjsWrapper() {
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "pdfjs-dist", "name": "pdfjs-dist",
"version": "1.1.101", "version": "1.1.103",
"description": "Generic build of Mozilla's PDF.js library.", "description": "Generic build of Mozilla's PDF.js library.",
"keywords": [ "keywords": [
"Mozilla", "Mozilla",

8
web/pdf_viewer.js

@ -923,10 +923,9 @@ var PDFPageView = (function PDFPageViewClosure() {
} }
this.textLayer = textLayer; this.textLayer = textLayer;
// TODO(mack): use data attributes to store these
ctx._scaleX = outputScale.sx;
ctx._scaleY = outputScale.sy;
if (outputScale.scaled) { 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); ctx.scale(outputScale.sx, outputScale.sy);
} }
@ -1068,6 +1067,9 @@ var PDFPageView = (function PDFPageViewClosure() {
ctx.fillStyle = 'rgb(255, 255, 255)'; ctx.fillStyle = 'rgb(255, 255, 255)';
ctx.fillRect(0, 0, canvas.width, canvas.height); ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.restore(); 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); ctx.scale(PRINT_OUTPUT_SCALE, PRINT_OUTPUT_SCALE);
var renderContext = { var renderContext = {

Loading…
Cancel
Save