PDFium Delphi Component Docs

CreateAttachment Método

Componente: TPdf  ·  Unidad: PDFium
Añade un nuevo archivo incrustado (adjunto) a nivel de documento

Syntax

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

Description

Añade un nuevo archivo incrustado (adjunto) a nivel de documento.

Devuelve el índice del adjunto; use AttachmentName/AttachmentType para enumerar.

Todas las ediciones de la página actual se almacenan en búfer en la representación en memoria de PDFium. Llame a UpdatePage para refrescar la caché de renderizado y a SaveToFile para persistir los cambios.

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