|
|
@ -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.289'; |
|
|
|
var pdfjsVersion = '1.5.292'; |
|
|
|
var pdfjsBuild = '70b3eea'; |
|
|
|
var pdfjsBuild = 'f97d521'; |
|
|
|
|
|
|
|
|
|
|
|
var pdfjsFilePath = |
|
|
|
var pdfjsFilePath = |
|
|
|
typeof document !== 'undefined' && document.currentScript ? |
|
|
|
typeof document !== 'undefined' && document.currentScript ? |
|
|
@ -17711,6 +17711,10 @@ function isRef(v) { |
|
|
|
return v instanceof Ref; |
|
|
|
return v instanceof Ref; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function isRefsEqual(v1, v2) { |
|
|
|
|
|
|
|
return v1.num === v2.num && v1.gen === v2.gen; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function isStream(v) { |
|
|
|
function isStream(v) { |
|
|
|
return typeof v === 'object' && v !== null && v.getBytes !== undefined; |
|
|
|
return typeof v === 'object' && v !== null && v.getBytes !== undefined; |
|
|
|
} |
|
|
|
} |
|
|
@ -17725,6 +17729,7 @@ exports.isCmd = isCmd; |
|
|
|
exports.isDict = isDict; |
|
|
|
exports.isDict = isDict; |
|
|
|
exports.isName = isName; |
|
|
|
exports.isName = isName; |
|
|
|
exports.isRef = isRef; |
|
|
|
exports.isRef = isRef; |
|
|
|
|
|
|
|
exports.isRefsEqual = isRefsEqual; |
|
|
|
exports.isStream = isStream; |
|
|
|
exports.isStream = isStream; |
|
|
|
})); |
|
|
|
})); |
|
|
|
|
|
|
|
|
|
|
@ -40100,7 +40105,12 @@ var WorkerTransport = (function WorkerTransportClosure() { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getPageIndex: function WorkerTransport_getPageIndexByRef(ref) { |
|
|
|
getPageIndex: function WorkerTransport_getPageIndexByRef(ref) { |
|
|
|
return this.messageHandler.sendWithPromise('GetPageIndex', { ref: ref }); |
|
|
|
return this.messageHandler.sendWithPromise('GetPageIndex', { ref: ref }). |
|
|
|
|
|
|
|
then(function (pageIndex) { |
|
|
|
|
|
|
|
return pageIndex; |
|
|
|
|
|
|
|
}, function (reason) { |
|
|
|
|
|
|
|
return Promise.reject(new Error(reason)); |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getAnnotations: function WorkerTransport_getAnnotations(pageIndex, intent) { |
|
|
|
getAnnotations: function WorkerTransport_getAnnotations(pageIndex, intent) { |
|
|
@ -42746,6 +42756,7 @@ var isName = corePrimitives.isName; |
|
|
|
var isCmd = corePrimitives.isCmd; |
|
|
|
var isCmd = corePrimitives.isCmd; |
|
|
|
var isDict = corePrimitives.isDict; |
|
|
|
var isDict = corePrimitives.isDict; |
|
|
|
var isRef = corePrimitives.isRef; |
|
|
|
var isRef = corePrimitives.isRef; |
|
|
|
|
|
|
|
var isRefsEqual = corePrimitives.isRefsEqual; |
|
|
|
var isStream = corePrimitives.isStream; |
|
|
|
var isStream = corePrimitives.isStream; |
|
|
|
var CipherTransformFactory = coreCrypto.CipherTransformFactory; |
|
|
|
var CipherTransformFactory = coreCrypto.CipherTransformFactory; |
|
|
|
var Lexer = coreParser.Lexer; |
|
|
|
var Lexer = coreParser.Lexer; |
|
|
@ -43212,7 +43223,7 @@ var Catalog = (function CatalogClosure() { |
|
|
|
return capability.promise; |
|
|
|
return capability.promise; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getPageIndex: function Catalog_getPageIndex(ref) { |
|
|
|
getPageIndex: function Catalog_getPageIndex(pageRef) { |
|
|
|
// The page tree nodes have the count of all the leaves below them. To get
|
|
|
|
// The page tree nodes have the count of all the leaves below them. To get
|
|
|
|
// how many pages are before we just have to walk up the tree and keep
|
|
|
|
// how many pages are before we just have to walk up the tree and keep
|
|
|
|
// adding the count of siblings to the left of the node.
|
|
|
|
// adding the count of siblings to the left of the node.
|
|
|
@ -43221,15 +43232,21 @@ var Catalog = (function CatalogClosure() { |
|
|
|
var total = 0; |
|
|
|
var total = 0; |
|
|
|
var parentRef; |
|
|
|
var parentRef; |
|
|
|
return xref.fetchAsync(kidRef).then(function (node) { |
|
|
|
return xref.fetchAsync(kidRef).then(function (node) { |
|
|
|
|
|
|
|
if (isRefsEqual(kidRef, pageRef) && !isDict(node, 'Page') && |
|
|
|
|
|
|
|
!(isDict(node) && !node.has('Type') && node.has('Contents'))) { |
|
|
|
|
|
|
|
throw new Error('The reference does not point to a /Page Dict.'); |
|
|
|
|
|
|
|
} |
|
|
|
if (!node) { |
|
|
|
if (!node) { |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
assert(isDict(node), 'node must be a Dict.'); |
|
|
|
parentRef = node.getRaw('Parent'); |
|
|
|
parentRef = node.getRaw('Parent'); |
|
|
|
return node.getAsync('Parent'); |
|
|
|
return node.getAsync('Parent'); |
|
|
|
}).then(function (parent) { |
|
|
|
}).then(function (parent) { |
|
|
|
if (!parent) { |
|
|
|
if (!parent) { |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
assert(isDict(parent), 'parent must be a Dict.'); |
|
|
|
return parent.getAsync('Kids'); |
|
|
|
return parent.getAsync('Kids'); |
|
|
|
}).then(function (kids) { |
|
|
|
}).then(function (kids) { |
|
|
|
if (!kids) { |
|
|
|
if (!kids) { |
|
|
@ -43239,7 +43256,7 @@ var Catalog = (function CatalogClosure() { |
|
|
|
var found = false; |
|
|
|
var found = false; |
|
|
|
for (var i = 0; i < kids.length; i++) { |
|
|
|
for (var i = 0; i < kids.length; i++) { |
|
|
|
var kid = kids[i]; |
|
|
|
var kid = kids[i]; |
|
|
|
assert(isRef(kid), 'kids must be a ref'); |
|
|
|
assert(isRef(kid), 'kid must be a Ref.'); |
|
|
|
if (kid.num === kidRef.num) { |
|
|
|
if (kid.num === kidRef.num) { |
|
|
|
found = true; |
|
|
|
found = true; |
|
|
|
break; |
|
|
|
break; |
|
|
@ -43275,7 +43292,7 @@ var Catalog = (function CatalogClosure() { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return next(ref); |
|
|
|
return next(pageRef); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -49085,9 +49102,17 @@ var LinkAnnotation = (function LinkAnnotationClosure() { |
|
|
|
if (isName(remoteDest)) { |
|
|
|
if (isName(remoteDest)) { |
|
|
|
remoteDest = remoteDest.name; |
|
|
|
remoteDest = remoteDest.name; |
|
|
|
} |
|
|
|
} |
|
|
|
if (isString(remoteDest) && isString(url)) { |
|
|
|
if (isString(url)) { |
|
|
|
var baseUrl = url.split('#')[0]; |
|
|
|
var baseUrl = url.split('#')[0]; |
|
|
|
url = baseUrl + '#' + remoteDest; |
|
|
|
if (isString(remoteDest)) { |
|
|
|
|
|
|
|
// In practice, a named destination may contain only a number.
|
|
|
|
|
|
|
|
// If that happens, use the '#nameddest=' form to avoid the link
|
|
|
|
|
|
|
|
// redirecting to a page, instead of the correct destination.
|
|
|
|
|
|
|
|
url = baseUrl + '#' + |
|
|
|
|
|
|
|
(/^\d+$/.test(remoteDest) ? 'nameddest=' : '') + remoteDest; |
|
|
|
|
|
|
|
} else if (isArray(remoteDest)) { |
|
|
|
|
|
|
|
url = baseUrl + '#' + JSON.stringify(remoteDest); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// The 'NewWindow' property, equal to `LinkTarget.BLANK`.
|
|
|
|
// The 'NewWindow' property, equal to `LinkTarget.BLANK`.
|
|
|
|