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

    • With LifecycleActionPolicy = lapAutomatic the component already runs these actions at the matching moments; manual execution is meant for lapManual hosts
    • dlaJavaScript runs the document-level JavaScript name-tree actions

Example

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

See Also