PDFium Delphi Component Docs

FileName property

Component: TPdf  ·  Unit: PDFium
Path of the PDF to open; assigned while Active is False before opening the document

Syntax

property FileName: string;

Description

Path of the PDF to open; it can only be assigned while the component is inactive, and assigning it while Active is True raises EPdfError

The path is passed to PDFium as UTF-8, so folders and file names in any script work; Free Pascal builds convert from the string's own code page, so this also holds when the program does not use the Lazarus UTF-8 string mode

Empty string means "no file" — use CreateDocument to start a blank PDF instead

Wraps the corresponding PDFium API and exposes it as a TPdf instance member so consumers do not have to manage FPDF_DOCUMENT handles directly

Remarks

Example

Pdf1.Active := False;
Pdf1.FileName := 'sample.pdf';
Pdf1.Active := True;

See Also

Active, Password, LoadCustomDocument