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 ran
ErrorMessage receives the failure reason when the result is False, for example when LifecycleActionPolicy is lapDisabled or the action is missing
LifecycleActionPolicy = lapAutomatic the component already runs these actions at the matching moments; manual execution is meant for lapManual hostsdlaJavaScript runs the document-level JavaScript name-tree actionsif not Pdf1.ExecuteDocumentLifecycleAction(dlaOpen, Err) then
Log(Err);