diff --git a/bower.json b/bower.json index 8df5c0027..c341f57a3 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.5.341", + "version": "1.5.343", "main": [ "build/pdf.js", "build/pdf.worker.js" diff --git a/build/pdf.combined.js b/build/pdf.combined.js index 9b27bf189..2c67aa056 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.5.341'; -var pdfjsBuild = '0da97ad'; +var pdfjsVersion = '1.5.343'; +var pdfjsBuild = '9228a04'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? @@ -30649,9 +30649,11 @@ exports.TilingPattern = TilingPattern; var Util = sharedUtil.Util; var assert = sharedUtil.assert; +var warn = sharedUtil.warn; var error = sharedUtil.error; var isInt = sharedUtil.isInt; var isString = sharedUtil.isString; +var MissingDataException = sharedUtil.MissingDataException; var isName = corePrimitives.isName; var isCmd = corePrimitives.isCmd; var isStream = corePrimitives.isStream; @@ -31499,41 +31501,49 @@ var CMapFactory = (function CMapFactoryClosure() { var previous; var embededUseCMap; objLoop: while (true) { - var obj = lexer.getObj(); - if (isEOF(obj)) { - break; - } else if (isName(obj)) { - if (obj.name === 'WMode') { - parseWMode(cMap, lexer); - } else if (obj.name === 'CMapName') { - parseCMapName(cMap, lexer); - } - previous = obj; - } else if (isCmd(obj)) { - switch (obj.cmd) { - case 'endcmap': - break objLoop; - case 'usecmap': - if (isName(previous)) { - embededUseCMap = previous.name; - } - break; - case 'begincodespacerange': - parseCodespaceRange(cMap, lexer); - break; - case 'beginbfchar': - parseBfChar(cMap, lexer); - break; - case 'begincidchar': - parseCidChar(cMap, lexer); - break; - case 'beginbfrange': - parseBfRange(cMap, lexer); - break; - case 'begincidrange': - parseCidRange(cMap, lexer); - break; + try { + var obj = lexer.getObj(); + if (isEOF(obj)) { + break; + } else if (isName(obj)) { + if (obj.name === 'WMode') { + parseWMode(cMap, lexer); + } else if (obj.name === 'CMapName') { + parseCMapName(cMap, lexer); + } + previous = obj; + } else if (isCmd(obj)) { + switch (obj.cmd) { + case 'endcmap': + break objLoop; + case 'usecmap': + if (isName(previous)) { + embededUseCMap = previous.name; + } + break; + case 'begincodespacerange': + parseCodespaceRange(cMap, lexer); + break; + case 'beginbfchar': + parseBfChar(cMap, lexer); + break; + case 'begincidchar': + parseCidChar(cMap, lexer); + break; + case 'beginbfrange': + parseBfRange(cMap, lexer); + break; + case 'begincidrange': + parseCidRange(cMap, lexer); + break; + } } + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn('Invalid cMap data: ' + ex); + continue; } } @@ -31544,9 +31554,8 @@ var CMapFactory = (function CMapFactoryClosure() { } if (useCMap) { return extendCMap(cMap, builtInCMapParams, useCMap); - } else { - return Promise.resolve(cMap); } + return Promise.resolve(cMap); } function extendCMap(cMap, builtInCMapParams, useCMap) { @@ -31608,8 +31617,6 @@ var CMapFactory = (function CMapFactoryClosure() { parseCMap(cMap, lexer, builtInCMapParams, null).then( function (parsedCMap) { resolve(parsedCMap); - }).catch(function (e) { - reject(new Error({ message: 'Invalid CMap data', error: e })); }); } else { reject(new Error('Unable to get cMap at: ' + url)); diff --git a/build/pdf.js b/build/pdf.js index d2db118e7..f64102b38 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.5.341'; -var pdfjsBuild = '0da97ad'; +var pdfjsVersion = '1.5.343'; +var pdfjsBuild = '9228a04'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? diff --git a/build/pdf.worker.js b/build/pdf.worker.js index 067512cce..cbaa2b6be 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.5.341'; -var pdfjsBuild = '0da97ad'; +var pdfjsVersion = '1.5.343'; +var pdfjsBuild = '9228a04'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? @@ -26785,9 +26785,11 @@ exports.Type1Parser = Type1Parser; var Util = sharedUtil.Util; var assert = sharedUtil.assert; +var warn = sharedUtil.warn; var error = sharedUtil.error; var isInt = sharedUtil.isInt; var isString = sharedUtil.isString; +var MissingDataException = sharedUtil.MissingDataException; var isName = corePrimitives.isName; var isCmd = corePrimitives.isCmd; var isStream = corePrimitives.isStream; @@ -27635,41 +27637,49 @@ var CMapFactory = (function CMapFactoryClosure() { var previous; var embededUseCMap; objLoop: while (true) { - var obj = lexer.getObj(); - if (isEOF(obj)) { - break; - } else if (isName(obj)) { - if (obj.name === 'WMode') { - parseWMode(cMap, lexer); - } else if (obj.name === 'CMapName') { - parseCMapName(cMap, lexer); - } - previous = obj; - } else if (isCmd(obj)) { - switch (obj.cmd) { - case 'endcmap': - break objLoop; - case 'usecmap': - if (isName(previous)) { - embededUseCMap = previous.name; - } - break; - case 'begincodespacerange': - parseCodespaceRange(cMap, lexer); - break; - case 'beginbfchar': - parseBfChar(cMap, lexer); - break; - case 'begincidchar': - parseCidChar(cMap, lexer); - break; - case 'beginbfrange': - parseBfRange(cMap, lexer); - break; - case 'begincidrange': - parseCidRange(cMap, lexer); - break; + try { + var obj = lexer.getObj(); + if (isEOF(obj)) { + break; + } else if (isName(obj)) { + if (obj.name === 'WMode') { + parseWMode(cMap, lexer); + } else if (obj.name === 'CMapName') { + parseCMapName(cMap, lexer); + } + previous = obj; + } else if (isCmd(obj)) { + switch (obj.cmd) { + case 'endcmap': + break objLoop; + case 'usecmap': + if (isName(previous)) { + embededUseCMap = previous.name; + } + break; + case 'begincodespacerange': + parseCodespaceRange(cMap, lexer); + break; + case 'beginbfchar': + parseBfChar(cMap, lexer); + break; + case 'begincidchar': + parseCidChar(cMap, lexer); + break; + case 'beginbfrange': + parseBfRange(cMap, lexer); + break; + case 'begincidrange': + parseCidRange(cMap, lexer); + break; + } } + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn('Invalid cMap data: ' + ex); + continue; } } @@ -27680,9 +27690,8 @@ var CMapFactory = (function CMapFactoryClosure() { } if (useCMap) { return extendCMap(cMap, builtInCMapParams, useCMap); - } else { - return Promise.resolve(cMap); } + return Promise.resolve(cMap); } function extendCMap(cMap, builtInCMapParams, useCMap) { @@ -27744,8 +27753,6 @@ var CMapFactory = (function CMapFactoryClosure() { parseCMap(cMap, lexer, builtInCMapParams, null).then( function (parsedCMap) { resolve(parsedCMap); - }).catch(function (e) { - reject(new Error({ message: 'Invalid CMap data', error: e })); }); } else { reject(new Error('Unable to get cMap at: ' + url)); diff --git a/package.json b/package.json index c5b66c019..b8d879532 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.5.341", + "version": "1.5.343", "main": "build/pdf.js", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [