function AddAnnotationFileAttachment(AnnotIndex: Integer; const Name: WString; const FileData: TBytes): Boolean;
| AnnotIndex | Integer. Zero-based index of the annotation on the current page, typically one of subtype anFileAttachment. |
| Name | WString. File name recorded for the attachment, as a viewer would show it. |
| FileData | TBytes. Bytes of the embedded file. An empty array creates the attachment entry with no contents. |
| Result | Boolean. True when both the attachment and its contents were written. |
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