From ff9e313589dc29398c5aeb180a619f64dc587211 Mon Sep 17 00:00:00 2001 From: Pdf Bot Date: Wed, 10 Feb 2016 17:07:29 +0000 Subject: [PATCH] PDF.js version 1.4.53 - See mozilla/pdf.js@33b57d7450807d7e6ab40fac9f67170b109fd249 --- bower.json | 2 +- build/pdf.combined.js | 35 ++++++++++++++++++++++++----------- build/pdf.js | 4 ++-- build/pdf.worker.js | 35 ++++++++++++++++++++++++----------- package.json | 2 +- 5 files changed, 52 insertions(+), 26 deletions(-) diff --git a/bower.json b/bower.json index d63f89870..b665ebac7 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.4.51", + "version": "1.4.53", "main": [ "build/pdf.js", "build/pdf.worker.js" diff --git a/build/pdf.combined.js b/build/pdf.combined.js index b92c97697..b4d23fb5b 100644 --- a/build/pdf.combined.js +++ b/build/pdf.combined.js @@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfCombined = {})); // Use strict in our context only - users might not want it 'use strict'; -var pdfjsVersion = '1.4.51'; -var pdfjsBuild = '03f12a1'; +var pdfjsVersion = '1.4.53'; +var pdfjsBuild = '33b57d7'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? @@ -45011,17 +45011,19 @@ var PartialEvaluator = (function PartialEvaluatorClosure() { processed[resources.objId] = true; } - var nodes = [resources]; + var nodes = [resources], xref = this.xref; while (nodes.length) { - var key; + var key, i, ii; var node = nodes.shift(); // First check the current resources for blend modes. var graphicStates = node.get('ExtGState'); if (isDict(graphicStates)) { - graphicStates = graphicStates.getAll(); - for (key in graphicStates) { - var graphicState = graphicStates[key]; - var bm = graphicState['BM']; + var graphicStatesKeys = graphicStates.getKeys(); + for (i = 0, ii = graphicStatesKeys.length; i < ii; i++) { + key = graphicStatesKeys[i]; + + var graphicState = graphicStates.get(key); + var bm = graphicState.get('BM'); if (isName(bm) && bm.name !== 'Normal') { return true; } @@ -45032,9 +45034,20 @@ var PartialEvaluator = (function PartialEvaluatorClosure() { if (!isDict(xObjects)) { continue; } - xObjects = xObjects.getAll(); - for (key in xObjects) { - var xObject = xObjects[key]; + var xObjectsKeys = xObjects.getKeys(); + for (i = 0, ii = xObjectsKeys.length; i < ii; i++) { + key = xObjectsKeys[i]; + + var xObject = xObjects.getRaw(key); + if (isRef(xObject)) { + if (processed[xObject.toString()]) { + // The XObject has already been processed, and by avoiding a + // redundant `xref.fetch` we can *significantly* reduce the load + // time for badly generated PDF files (fixes issue6961.pdf). + continue; + } + xObject = xref.fetch(xObject); + } if (!isStream(xObject)) { continue; } diff --git a/build/pdf.js b/build/pdf.js index 9f038ffab..90b7176ac 100644 --- a/build/pdf.js +++ b/build/pdf.js @@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdf = {})); // Use strict in our context only - users might not want it 'use strict'; -var pdfjsVersion = '1.4.51'; -var pdfjsBuild = '03f12a1'; +var pdfjsVersion = '1.4.53'; +var pdfjsBuild = '33b57d7'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? diff --git a/build/pdf.worker.js b/build/pdf.worker.js index 183a93fd7..0607ce89e 100644 --- a/build/pdf.worker.js +++ b/build/pdf.worker.js @@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfWorker = {})); // Use strict in our context only - users might not want it 'use strict'; -var pdfjsVersion = '1.4.51'; -var pdfjsBuild = '03f12a1'; +var pdfjsVersion = '1.4.53'; +var pdfjsBuild = '33b57d7'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? @@ -37160,17 +37160,19 @@ var PartialEvaluator = (function PartialEvaluatorClosure() { processed[resources.objId] = true; } - var nodes = [resources]; + var nodes = [resources], xref = this.xref; while (nodes.length) { - var key; + var key, i, ii; var node = nodes.shift(); // First check the current resources for blend modes. var graphicStates = node.get('ExtGState'); if (isDict(graphicStates)) { - graphicStates = graphicStates.getAll(); - for (key in graphicStates) { - var graphicState = graphicStates[key]; - var bm = graphicState['BM']; + var graphicStatesKeys = graphicStates.getKeys(); + for (i = 0, ii = graphicStatesKeys.length; i < ii; i++) { + key = graphicStatesKeys[i]; + + var graphicState = graphicStates.get(key); + var bm = graphicState.get('BM'); if (isName(bm) && bm.name !== 'Normal') { return true; } @@ -37181,9 +37183,20 @@ var PartialEvaluator = (function PartialEvaluatorClosure() { if (!isDict(xObjects)) { continue; } - xObjects = xObjects.getAll(); - for (key in xObjects) { - var xObject = xObjects[key]; + var xObjectsKeys = xObjects.getKeys(); + for (i = 0, ii = xObjectsKeys.length; i < ii; i++) { + key = xObjectsKeys[i]; + + var xObject = xObjects.getRaw(key); + if (isRef(xObject)) { + if (processed[xObject.toString()]) { + // The XObject has already been processed, and by avoiding a + // redundant `xref.fetch` we can *significantly* reduce the load + // time for badly generated PDF files (fixes issue6961.pdf). + continue; + } + xObject = xref.fetch(xObject); + } if (!isStream(xObject)) { continue; } diff --git a/package.json b/package.json index b78ea83bf..c73c5d750 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.4.51", + "version": "1.4.53", "main": "build/pdf.js", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [