PDFium Delphi Component Docs

CreateAttachment Metodo

Componente: TPdf  ·  Unità: PDFium
Aggiunge un nuovo file incorporato (allegato) a livello di documento

Syntax

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

Description

Aggiunge un nuovo file incorporato (allegato) a livello di documento

Restituisce l'indice dell'allegato; usa AttachmentName/AttachmentType per enumerare

Tutte le modifiche alla pagina corrente sono memorizzate nel buffer nella rappresentazione in memoria di PDFium. Chiama UpdatePage per aggiornare la cache di rendering e SaveToFile per persistere le modifiche

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