THotPDF.AddLoadedDocumentJavaScript Method
Adds a document-level JavaScript to a loaded PDF, or replaces the script of an existing name. The script is stored as a JavaScript action in the Catalog /Names /JavaScript name tree at its sorted position and is written by the next SaveLoadedDocument or incremental update; GetLoadedJavaScriptSource returns it straight away
Declaration
procedure AddLoadedDocumentJavaScript(const AName, ABody: AnsiString);
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
AName | PDF resource name, packet name, profile name or caller-defined identifier |
ABody | Input supplied to AddLoadedDocumentJavaScript |
Return value
This member returns no value
Usage notes
- Use this API in the document creation workflow before the affected page, resource, field or catalogue object is finalised
- Keep object names, field names, resource names and returned handles stable until the document is finalised
- Loaded-document object references may be indirect; resolve arrays, dictionaries or streams before inspecting nested values