TPDFlibViewerFileOpen

Data types, viewer interaction, actions

Description

Action that opens a document through a file open dialog

The constructor presets Caption to Open... and Hint to Open a PDF document; executing shows a TOpenDialog filtered to PDF files with ofFileMustExist, records the picked name in LastFileName and loads it with LoadFromFile and an empty password

Unlike the other viewer actions it stays enabled without an open document, because opening one is its purpose

Declaration

TPDFlibViewerFileOpen = class(TPDFlibViewerAction) private FLastFileName: WideString; protected function DoUpdate: Boolean; override; procedure DoExecute; override; public constructor Create(AOwner: TComponent); override; property LastFileName: WideString read FLastFileName; end;

Key members

LastFileNameFile name picked by the most recent open dialog, also the file the viewer loaded

See also

TPDFlibViewerAction, LoadFromFile, TPDFlibViewerFileSaveAs, TPDFlibViewer