PDFium Delphi Component Docs

ExecuteDocumentLifecycleAction method

Component: TPdf  ·  Unit: PDFium
Runs one document-level lifecycle action on demand

Syntax

function ExecuteDocumentLifecycleAction(Action: TPdfDocumentLifecycleAction; out ErrorMessage: string): Boolean;

Description

ExecuteDocumentLifecycleAction executes one of the document-level actions dlaJavaScript, dlaOpen, dlaWillClose, dlaWillSave, dlaDidSave, dlaWillPrint, or dlaDidPrint and returns True when the action ran

ErrorMessage receives the failure reason when the result is False, for example when LifecycleActionPolicy is lapDisabled or the action is missing

Remarks

Example

if not Pdf1.ExecuteDocumentLifecycleAction(dlaOpen, Err) then
  Log(Err);

See Also

ExecutePageLifecycleAction, LifecycleActionPolicy, Lifecycle actions, JavaScriptActions