PDFium Delphi Component Docs

Método AddAnnotationFileAttachment

Componente: TPdf  ·  Unidade: PDFium
Anexa um ficheiro incorporado a uma anotação existente e preenche o respetivo conteúdo numa única chamada

Syntax

function AddAnnotationFileAttachment(AnnotIndex: Integer; const Name: WString; const FileData: TBytes): Boolean;

AnnotIndexInteger. Zero-based index of the annotation on the current page, typically one of subtype anFileAttachment.
NameWString. File name recorded for the attachment, as a viewer would show it.
FileDataTBytes. Bytes of the embedded file. An empty array creates the attachment entry with no contents.
ResultBoolean. True when both the attachment and its contents were written.

Description

Attaches a file to one annotation, which is what a FileAttachment annotation shows as its paperclip or pushpin marker. Document-level attachments are separate and go through CreateAttachment

On success the page is marked as modified, so a following SaveAs carries the attachment into the file

A False result means nothing was attached: either the annotation could not be opened or the PDFium build does not export annotation attachments

See Also

CreateAttachment, Attachment, CreateAnnotation, AttachmentName