mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
Add tagged annotations in the structure tree (bug 1850797)
This commit is contained in:
parent
92f7653cfb
commit
d185db2b70
10 changed files with 152 additions and 47 deletions
|
@ -651,6 +651,9 @@ class Page {
|
|||
if (!structTreeRoot) {
|
||||
return null;
|
||||
}
|
||||
// Ensure that the structTree will contain the page's annotations.
|
||||
await this._parsedAnnotations;
|
||||
|
||||
const structTree = await this.pdfManager.ensure(this, "_parseStructTree", [
|
||||
structTreeRoot,
|
||||
]);
|
||||
|
@ -662,7 +665,7 @@ class Page {
|
|||
*/
|
||||
_parseStructTree(structTreeRoot) {
|
||||
const tree = new StructTreePage(structTreeRoot, this.pageDict);
|
||||
tree.parse();
|
||||
tree.parse(this.ref);
|
||||
return tree;
|
||||
}
|
||||
|
||||
|
@ -740,7 +743,8 @@ class Page {
|
|||
annotationRef,
|
||||
this.pdfManager,
|
||||
this._localIdFactory,
|
||||
/* collectFields */ false
|
||||
/* collectFields */ false,
|
||||
this.ref
|
||||
).catch(function (reason) {
|
||||
warn(`_parsedAnnotations: "${reason}".`);
|
||||
return null;
|
||||
|
@ -1719,7 +1723,8 @@ class PDFDocument {
|
|||
fieldRef,
|
||||
this.pdfManager,
|
||||
this._localIdFactory,
|
||||
/* collectFields */ true
|
||||
/* collectFields */ true,
|
||||
/* pageRef */ null
|
||||
)
|
||||
.then(annotation => annotation?.getFieldObject())
|
||||
.catch(function (reason) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue