function ExecuteDocumentLifecycleAction(Action: TPdfDocumentLifecycleAction; out ErrorMessage: string): Boolean;
ExecuteDocumentLifecycleAction executes one of the document-level actions dlaJavaScript, dlaOpen, dlaWillClose, dlaWillSave, dlaDidSave, dlaWillPrint, or dlaDidPrint and returns True when the action has run
ErrorMessage receives the failure reason when the result is False, for example when LifecycleActionPolicy is lapDisabled or the action is absent
LifecycleActionPolicy = lapAutomatic the component already runs these actions at the matching moments; manual execution is intended for lapManual hostsdlaJavaScript runs the document-level JavaScript name-tree actionsif not Pdf1.ExecuteDocumentLifecycleAction(dlaOpen, Err) then
Log(Err);