1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

JS - Collect and execute actions at doc and pages level

* the goal is to execute actions like Open or OpenAction
 * can be tested with issue6106.pdf (auto-print)
 * once #12701 is merged, we can add page actions
This commit is contained in:
Calixte Denizet 2020-12-07 19:22:14 +01:00
parent 142f131ee1
commit 1e2173f038
18 changed files with 829 additions and 125 deletions

View file

@ -24,6 +24,7 @@ import {
isNum,
isString,
OPS,
PageActionEventType,
shadow,
stringToBytes,
stringToPDFString,
@ -42,6 +43,7 @@ import {
Ref,
} from "./primitives.js";
import {
collectActions,
getInheritableProperty,
isWhiteSpace,
MissingDataException,
@ -467,6 +469,16 @@ class Page {
return shadow(this, "_parsedAnnotations", parsedAnnotations);
}
get jsActions() {
const actions = collectActions(
this.xref,
this.pageDict,
PageActionEventType
);
return shadow(this, "jsActions", actions);
}
}
const PDF_HEADER_SIGNATURE = new Uint8Array([0x25, 0x50, 0x44, 0x46, 0x2d]);