PDFium Delphi Component Docs

OnNamedAction event

Component: TPdf  ·  Unit: PDFium
Raised when the document asks the viewer to perform a named action

Syntax

property OnNamedAction: TPdfNamedActionEvent;

SenderTObject. The TPdf instance raising the event
ActionNamestring. Name of the requested action, such as NextPage or an application-defined name
HandledBoolean. Set to True to suppress the default behaviour for that name

Description

Fires when a document-raised action reaches the component - from an OpenAction, a form button, or a script. The four standard navigation names move PageNumber by default

Assign the event and set Handled to True to take a name over: a host that owns its own navigation, for example, can scroll its viewer rather than letting the page number jump

Names the library does not act on also arrive here, which is how an application implements document-defined actions of its own

Example

procedure TForm1.PdfNamedAction(Sender: TObject;
  const ActionName: string; var Handled: Boolean);
begin
  if ActionName = 'Print' then
  begin
    ShowPrintDialog;
    Handled := True;
  end;
end;

See Also

PerformNamedAction, PageNumber, OnPageChange, OnJavaScriptPrint