* Load AcroForm from catalog. * Returns null if no AcroForm present. * * @param catalog The document catalog dictionary * @param registry The object registry for resolving references * @param pageTree Optional page tree for efficient page lookups during flattening
(catalog: PdfDict, registry: ObjectRegistry, pageTree?: PDFPageTree)
| 71 | * @param pageTree Optional page tree for efficient page lookups during flattening |
| 72 | */ |
| 73 | static load(catalog: PdfDict, registry: ObjectRegistry, pageTree?: PDFPageTree): AcroForm | null { |
| 74 | const resolve = registry.resolve.bind(registry); |
| 75 | const dict = catalog.getDict("AcroForm", resolve); |
| 76 | |
| 77 | if (!dict) { |
| 78 | return null; |
| 79 | } |
| 80 | |
| 81 | return new AcroForm(dict, registry, pageTree ?? null, catalog); |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * Default resources dictionary (fonts, etc.). |