PDFium Component Docs

CreateAttachment method

Component: TPdf  ·  Unit: PDFium
Menambahkan file tersemat baru (attachment) pada tingkat dokumen

Syntax

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

Description

Menambahkan file tersemat baru (attachment) pada tingkat dokumen

Mengembalikan indeks lampiran; gunakan AttachmentName/AttachmentType untuk enumerasi

Semua suntingan ke halaman saat ini dibuffer dalam representasi in-memory PDFium. Panggil UpdatePage untuk menyegarkan cache rendering dan SaveToFile untuk mempertahankan perubahan

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