PDFium Delphi Component Docs

CreateAttachment メソッド

コンポーネント: TPdf  ·  ユニット: PDFium
文書レベルで新しい埋め込みファイル(添付ファイル)を追加します

Syntax

function CreateAttachment(const Name: WString; const Data: TBytes; const MimeType: WString = ''): Integer

Description

文書レベルで新しい埋め込みファイル(添付ファイル)を追加します

添付ファイルインデックスを返します。列挙には AttachmentName/AttachmentType を使います

現在ページへの編集はすべて PDFium のメモリ内表現にバッファーされます。レンダリングキャッシュを更新するには UpdatePage を、変更を永続化するには SaveToFile を呼び出します

Remarks

Example

begin
  if Pdf1.Active then
  begin
    Pdf1.MoveTo(100, 100);
    Pdf1.LineTo(200, 150);
    Pdf1.LineTo(200, 200);
    Pdf1.ClosePath;
    Pdf1.AddPath(clRed, 1.5, clYellow, fmWinding);
    Pdf1.UpdatePage;
  end;
end;

See Also

Attachment, AttachmentCount, DeleteAttachment