Browse Source

PDF.js version 1.5.381 - See mozilla/pdf.js@b4c8814fc9b346cce38b224389bf4cf971a752b8

master v1.5.381
Pdf Bot 9 years ago
parent
commit
4cdb5f7be0
  1. 2
      bower.json
  2. 48
      build/pdf.combined.js
  3. 4
      build/pdf.js
  4. 48
      build/pdf.worker.js
  5. 2
      package.json

2
bower.json

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

48
build/pdf.combined.js

@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfCombined = {}));
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
'use strict'; 'use strict';
var pdfjsVersion = '1.5.378'; var pdfjsVersion = '1.5.381';
var pdfjsBuild = '084fc51'; var pdfjsBuild = 'b4c8814';
var pdfjsFilePath = var pdfjsFilePath =
typeof document !== 'undefined' && document.currentScript ? typeof document !== 'undefined' && document.currentScript ?
@ -17685,8 +17685,8 @@ var RefSetCache = (function RefSetCacheClosure() {
return RefSetCache; return RefSetCache;
})(); })();
function isName(v) { function isName(v, name) {
return v instanceof Name; return v instanceof Name && (name === undefined || v.name === name);
} }
function isCmd(v, cmd) { function isCmd(v, cmd) {
@ -17694,14 +17694,8 @@ function isCmd(v, cmd) {
} }
function isDict(v, type) { function isDict(v, type) {
if (!(v instanceof Dict)) { return v instanceof Dict &&
return false; (type === undefined || isName(v.get('Type'), type));
}
if (!type) {
return true;
}
var dictType = v.get('Type');
return isName(dictType) && dictType.name === type;
} }
function isRef(v) { function isRef(v) {
@ -27502,7 +27496,7 @@ var CipherTransformFactory = (function CipherTransformFactoryClosure() {
function CipherTransformFactory(dict, fileId, password) { function CipherTransformFactory(dict, fileId, password) {
var filter = dict.get('Filter'); var filter = dict.get('Filter');
if (!isName(filter) || filter.name !== 'Standard') { if (!isName(filter, 'Standard')) {
error('unknown encryption method'); error('unknown encryption method');
} }
this.dict = dict; this.dict = dict;
@ -42819,8 +42813,7 @@ var Catalog = (function CatalogClosure() {
var type = stream.dict.get('Type'); var type = stream.dict.get('Type');
var subtype = stream.dict.get('Subtype'); var subtype = stream.dict.get('Subtype');
if (isName(type) && isName(subtype) && if (isName(type, 'Metadata') && isName(subtype, 'XML')) {
type.name === 'Metadata' && subtype.name === 'XML') {
// XXX: This should examine the charset the XML document defines, // XXX: This should examine the charset the XML document defines,
// however since there are currently no real means to decode // however since there are currently no real means to decode
// arbitrary charsets, let's just hope that the author of the PDF // arbitrary charsets, let's just hope that the author of the PDF
@ -43029,7 +43022,7 @@ var Catalog = (function CatalogClosure() {
assert(isDict(labelDict), 'The PageLabel is not a dictionary.'); assert(isDict(labelDict), 'The PageLabel is not a dictionary.');
var type = labelDict.get('Type'); var type = labelDict.get('Type');
assert(!type || (isName(type) && type.name === 'PageLabel'), assert(!type || isName(type, 'PageLabel'),
'Invalid type in PageLabel dictionary.'); 'Invalid type in PageLabel dictionary.');
var s = labelDict.get('S'); var s = labelDict.get('S');
@ -43107,7 +43100,7 @@ var Catalog = (function CatalogClosure() {
var javaScript = []; var javaScript = [];
function appendIfJavaScriptDict(jsDict) { function appendIfJavaScriptDict(jsDict) {
var type = jsDict.get('S'); var type = jsDict.get('S');
if (!isName(type) || type.name !== 'JavaScript') { if (!isName(type, 'JavaScript')) {
return; return;
} }
var js = jsDict.get('JS'); var js = jsDict.get('JS');
@ -43135,11 +43128,11 @@ var Catalog = (function CatalogClosure() {
var openactionDict = this.catDict.get('OpenAction'); var openactionDict = this.catDict.get('OpenAction');
if (isDict(openactionDict, 'Action')) { if (isDict(openactionDict, 'Action')) {
var actionType = openactionDict.get('S'); var actionType = openactionDict.get('S');
if (isName(actionType) && actionType.name === 'Named') { if (isName(actionType, 'Named')) {
// The named Print action is not a part of the PDF 1.7 specification, // The named Print action is not a part of the PDF 1.7 specification,
// but is supported by many PDF readers/writers (including Adobe's). // but is supported by many PDF readers/writers (including Adobe's).
var action = openactionDict.get('N'); var action = openactionDict.get('N');
if (isName(action) && action.name === 'Print') { if (isName(action, 'Print')) {
javaScript.push('print({});'); javaScript.push('print({});');
} }
} else { } else {
@ -45412,7 +45405,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
var groupSubtype = group.get('S'); var groupSubtype = group.get('S');
var colorSpace; var colorSpace;
if (isName(groupSubtype) && groupSubtype.name === 'Transparency') { if (isName(groupSubtype, 'Transparency')) {
groupOptions.isolated = (group.get('I') || false); groupOptions.isolated = (group.get('I') || false);
groupOptions.knockout = (group.get('K') || false); groupOptions.knockout = (group.get('K') || false);
colorSpace = (group.has('CS') ? colorSpace = (group.has('CS') ?
@ -45707,7 +45700,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
gStateObj.push([key, value]); gStateObj.push([key, value]);
break; break;
case 'SMask': case 'SMask':
if (isName(value) && value.name === 'None') { if (isName(value, 'None')) {
gStateObj.push([key, false]); gStateObj.push([key, false]);
break; break;
} }
@ -46015,8 +46008,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
assert(isStream(xobj), 'XObject should be a stream'); assert(isStream(xobj), 'XObject should be a stream');
var type = xobj.dict.get('Subtype'); var type = xobj.dict.get('Subtype');
assert(isName(type), assert(isName(type), 'XObject should have a Name subtype');
'XObject should have a Name subtype');
if (type.name === 'Form') { if (type.name === 'Form') {
stateManager.save(); stateManager.save();
@ -46727,8 +46719,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
assert(isStream(xobj), 'XObject should be a stream'); assert(isStream(xobj), 'XObject should be a stream');
var type = xobj.dict.get('Subtype'); var type = xobj.dict.get('Subtype');
assert(isName(type), assert(isName(type), 'XObject should have a Name subtype');
'XObject should have a Name subtype');
if ('Form' !== type.name) { if ('Form' !== type.name) {
xobjsCache.key = name; xobjsCache.key = name;
@ -48497,7 +48488,7 @@ AnnotationFactory.prototype = /** @lends AnnotationFactory.prototype */ {
case 'Widget': case 'Widget':
var fieldType = Util.getInheritableProperty(dict, 'FT'); var fieldType = Util.getInheritableProperty(dict, 'FT');
if (isName(fieldType) && fieldType.name === 'Tx') { if (isName(fieldType, 'Tx')) {
return new TextWidgetAnnotation(parameters); return new TextWidgetAnnotation(parameters);
} }
return new WidgetAnnotation(parameters); return new WidgetAnnotation(parameters);
@ -48742,10 +48733,9 @@ var Annotation = (function AnnotationClosure() {
} }
if (borderStyle.has('BS')) { if (borderStyle.has('BS')) {
var dict = borderStyle.get('BS'); var dict = borderStyle.get('BS');
var dictType; var dictType = dict.get('Type');
if (!dict.has('Type') || (isName(dictType = dict.get('Type')) && if (!dictType || isName(dictType, 'Border')) {
dictType.name === 'Border')) {
this.borderStyle.setWidth(dict.get('W')); this.borderStyle.setWidth(dict.get('W'));
this.borderStyle.setStyle(dict.get('S')); this.borderStyle.setStyle(dict.get('S'));
this.borderStyle.setDashArray(dict.getArray('D')); this.borderStyle.setDashArray(dict.getArray('D'));

4
build/pdf.js

@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdf = {}));
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
'use strict'; 'use strict';
var pdfjsVersion = '1.5.378'; var pdfjsVersion = '1.5.381';
var pdfjsBuild = '084fc51'; var pdfjsBuild = 'b4c8814';
var pdfjsFilePath = var pdfjsFilePath =
typeof document !== 'undefined' && document.currentScript ? typeof document !== 'undefined' && document.currentScript ?

48
build/pdf.worker.js vendored

@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfWorker = {}));
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
'use strict'; 'use strict';
var pdfjsVersion = '1.5.378'; var pdfjsVersion = '1.5.381';
var pdfjsBuild = '084fc51'; var pdfjsBuild = 'b4c8814';
var pdfjsFilePath = var pdfjsFilePath =
typeof document !== 'undefined' && document.currentScript ? typeof document !== 'undefined' && document.currentScript ?
@ -17685,8 +17685,8 @@ var RefSetCache = (function RefSetCacheClosure() {
return RefSetCache; return RefSetCache;
})(); })();
function isName(v) { function isName(v, name) {
return v instanceof Name; return v instanceof Name && (name === undefined || v.name === name);
} }
function isCmd(v, cmd) { function isCmd(v, cmd) {
@ -17694,14 +17694,8 @@ function isCmd(v, cmd) {
} }
function isDict(v, type) { function isDict(v, type) {
if (!(v instanceof Dict)) { return v instanceof Dict &&
return false; (type === undefined || isName(v.get('Type'), type));
}
if (!type) {
return true;
}
var dictType = v.get('Type');
return isName(dictType) && dictType.name === type;
} }
function isRef(v) { function isRef(v) {
@ -24071,7 +24065,7 @@ var CipherTransformFactory = (function CipherTransformFactoryClosure() {
function CipherTransformFactory(dict, fileId, password) { function CipherTransformFactory(dict, fileId, password) {
var filter = dict.get('Filter'); var filter = dict.get('Filter');
if (!isName(filter) || filter.name !== 'Standard') { if (!isName(filter, 'Standard')) {
error('unknown encryption method'); error('unknown encryption method');
} }
this.dict = dict; this.dict = dict;
@ -34470,8 +34464,7 @@ var Catalog = (function CatalogClosure() {
var type = stream.dict.get('Type'); var type = stream.dict.get('Type');
var subtype = stream.dict.get('Subtype'); var subtype = stream.dict.get('Subtype');
if (isName(type) && isName(subtype) && if (isName(type, 'Metadata') && isName(subtype, 'XML')) {
type.name === 'Metadata' && subtype.name === 'XML') {
// XXX: This should examine the charset the XML document defines, // XXX: This should examine the charset the XML document defines,
// however since there are currently no real means to decode // however since there are currently no real means to decode
// arbitrary charsets, let's just hope that the author of the PDF // arbitrary charsets, let's just hope that the author of the PDF
@ -34680,7 +34673,7 @@ var Catalog = (function CatalogClosure() {
assert(isDict(labelDict), 'The PageLabel is not a dictionary.'); assert(isDict(labelDict), 'The PageLabel is not a dictionary.');
var type = labelDict.get('Type'); var type = labelDict.get('Type');
assert(!type || (isName(type) && type.name === 'PageLabel'), assert(!type || isName(type, 'PageLabel'),
'Invalid type in PageLabel dictionary.'); 'Invalid type in PageLabel dictionary.');
var s = labelDict.get('S'); var s = labelDict.get('S');
@ -34758,7 +34751,7 @@ var Catalog = (function CatalogClosure() {
var javaScript = []; var javaScript = [];
function appendIfJavaScriptDict(jsDict) { function appendIfJavaScriptDict(jsDict) {
var type = jsDict.get('S'); var type = jsDict.get('S');
if (!isName(type) || type.name !== 'JavaScript') { if (!isName(type, 'JavaScript')) {
return; return;
} }
var js = jsDict.get('JS'); var js = jsDict.get('JS');
@ -34786,11 +34779,11 @@ var Catalog = (function CatalogClosure() {
var openactionDict = this.catDict.get('OpenAction'); var openactionDict = this.catDict.get('OpenAction');
if (isDict(openactionDict, 'Action')) { if (isDict(openactionDict, 'Action')) {
var actionType = openactionDict.get('S'); var actionType = openactionDict.get('S');
if (isName(actionType) && actionType.name === 'Named') { if (isName(actionType, 'Named')) {
// The named Print action is not a part of the PDF 1.7 specification, // The named Print action is not a part of the PDF 1.7 specification,
// but is supported by many PDF readers/writers (including Adobe's). // but is supported by many PDF readers/writers (including Adobe's).
var action = openactionDict.get('N'); var action = openactionDict.get('N');
if (isName(action) && action.name === 'Print') { if (isName(action, 'Print')) {
javaScript.push('print({});'); javaScript.push('print({});');
} }
} else { } else {
@ -37063,7 +37056,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
var groupSubtype = group.get('S'); var groupSubtype = group.get('S');
var colorSpace; var colorSpace;
if (isName(groupSubtype) && groupSubtype.name === 'Transparency') { if (isName(groupSubtype, 'Transparency')) {
groupOptions.isolated = (group.get('I') || false); groupOptions.isolated = (group.get('I') || false);
groupOptions.knockout = (group.get('K') || false); groupOptions.knockout = (group.get('K') || false);
colorSpace = (group.has('CS') ? colorSpace = (group.has('CS') ?
@ -37358,7 +37351,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
gStateObj.push([key, value]); gStateObj.push([key, value]);
break; break;
case 'SMask': case 'SMask':
if (isName(value) && value.name === 'None') { if (isName(value, 'None')) {
gStateObj.push([key, false]); gStateObj.push([key, false]);
break; break;
} }
@ -37666,8 +37659,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
assert(isStream(xobj), 'XObject should be a stream'); assert(isStream(xobj), 'XObject should be a stream');
var type = xobj.dict.get('Subtype'); var type = xobj.dict.get('Subtype');
assert(isName(type), assert(isName(type), 'XObject should have a Name subtype');
'XObject should have a Name subtype');
if (type.name === 'Form') { if (type.name === 'Form') {
stateManager.save(); stateManager.save();
@ -38378,8 +38370,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
assert(isStream(xobj), 'XObject should be a stream'); assert(isStream(xobj), 'XObject should be a stream');
var type = xobj.dict.get('Subtype'); var type = xobj.dict.get('Subtype');
assert(isName(type), assert(isName(type), 'XObject should have a Name subtype');
'XObject should have a Name subtype');
if ('Form' !== type.name) { if ('Form' !== type.name) {
xobjsCache.key = name; xobjsCache.key = name;
@ -40148,7 +40139,7 @@ AnnotationFactory.prototype = /** @lends AnnotationFactory.prototype */ {
case 'Widget': case 'Widget':
var fieldType = Util.getInheritableProperty(dict, 'FT'); var fieldType = Util.getInheritableProperty(dict, 'FT');
if (isName(fieldType) && fieldType.name === 'Tx') { if (isName(fieldType, 'Tx')) {
return new TextWidgetAnnotation(parameters); return new TextWidgetAnnotation(parameters);
} }
return new WidgetAnnotation(parameters); return new WidgetAnnotation(parameters);
@ -40393,10 +40384,9 @@ var Annotation = (function AnnotationClosure() {
} }
if (borderStyle.has('BS')) { if (borderStyle.has('BS')) {
var dict = borderStyle.get('BS'); var dict = borderStyle.get('BS');
var dictType; var dictType = dict.get('Type');
if (!dict.has('Type') || (isName(dictType = dict.get('Type')) && if (!dictType || isName(dictType, 'Border')) {
dictType.name === 'Border')) {
this.borderStyle.setWidth(dict.get('W')); this.borderStyle.setWidth(dict.get('W'));
this.borderStyle.setStyle(dict.get('S')); this.borderStyle.setStyle(dict.get('S'));
this.borderStyle.setDashArray(dict.getArray('D')); this.borderStyle.setDashArray(dict.getArray('D'));

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "pdfjs-dist", "name": "pdfjs-dist",
"version": "1.5.378", "version": "1.5.381",
"main": "build/pdf.js", "main": "build/pdf.js",
"description": "Generic build of Mozilla's PDF.js library.", "description": "Generic build of Mozilla's PDF.js library.",
"keywords": [ "keywords": [

Loading…
Cancel
Save