mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 10:15:37 +02:00
Add support for the /Catalog Base-URI when resolving URLs (issue 14802)
As far as I can tell, this is actually the very first time that we've seen a PDF document with a Base-URI specified in the /Catalog; please refer to the specification: https://web.archive.org/web/20220309040754if_/https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf#G11.2097122 To simplify the overall implementation, this new parameter is accessed via the existing `BasePdfManager.docBaseUrl`-getter and will thus override any user-specified `docBaseUrl` API-parameter.
This commit is contained in:
parent
32ae0e4867
commit
5bc7339c1b
6 changed files with 126 additions and 5 deletions
|
@ -72,9 +72,12 @@ class AnnotationFactory {
|
|||
static create(xref, ref, pdfManager, idFactory, collectFields) {
|
||||
return Promise.all([
|
||||
pdfManager.ensureCatalog("acroForm"),
|
||||
// Only necessary to prevent the `pdfManager.docBaseUrl`-getter, used
|
||||
// with certain Annotations, from throwing and thus breaking parsing:
|
||||
pdfManager.ensureCatalog("baseUrl"),
|
||||
pdfManager.ensureDoc("xfaDatasets"),
|
||||
collectFields ? this._getPageIndex(xref, ref, pdfManager) : -1,
|
||||
]).then(([acroForm, xfaDatasets, pageIndex]) =>
|
||||
]).then(([acroForm, baseUrl, xfaDatasets, pageIndex]) =>
|
||||
pdfManager.ensure(this, "_create", [
|
||||
xref,
|
||||
ref,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue