mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 01:58:06 +02:00
Move the AcroForm logic from the document to the catalog
The `AcroForm` entry is part of the catalog, not of the document, so its logic should be placed there instead. The document should look in the catalog to fetch it, and not have knowledge of `catDict`, which is a member internal to the catalog. Moreover, make the AcroForm member private on the document instance. It's only used internally and was also never intended to be public. For users it's exposed by the `getMetadata` API endpoint as `IsAcroFormPresent`. Only a boolean is exposed, so we now also only store the boolean on the document instance. Finally, the annotation code needs access to the full AcroForm dictionary, so it's updated to fetch the data from the catalog instead of the document that now only holds the boolean.
This commit is contained in:
parent
b41a2f4d5a
commit
f20f0bcc78
4 changed files with 29 additions and 19 deletions
|
@ -51,7 +51,7 @@ class AnnotationFactory {
|
|||
* instance.
|
||||
*/
|
||||
static create(xref, ref, pdfManager, idFactory) {
|
||||
return pdfManager.ensureDoc("acroForm").then(acroForm => {
|
||||
return pdfManager.ensureCatalog("acroForm").then(acroForm => {
|
||||
return pdfManager.ensure(this, "_create", [
|
||||
xref,
|
||||
ref,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue