PDFium Delphi Component 文件

FileName 属性

组件: TPdf  ·  单元: PDFium
要打开的 PDF 路径;在 Active 为 True 时赋值会从新路径重新加载

Syntax

property FileName;

Description

要打开的 PDF 路径;只有在组件非激活时才能赋值,Active 为 True 时赋值会抛出 EPdfError

路径以 UTF-8 传给 PDFium,因此任何文字的文件夹和文件名都可用;Free Pascal 构建会从字符串自身的代码页转换,程序不使用 Lazarus UTF-8 字符串模式时同样成立

空字符串表示“无文件” — 改用 CreateDocument 启动一个空白 PDF

封装对应的 PDFium API 并将其作为 TPdf 实例成员公开,因此使用者无需直接管理 FPDF_DOCUMENT 句柄

Remarks

Example

if Pdf1.Active then
  Pdf1.FileName;

See Also

Active, Password, LoadCustomDocument