function DeleteAttachment(Index: Integer): Boolean;
Removes the embedded file attachment at the given index
Indices shift down after deletion; delete top-down to remove multiple at once
All edits to the current page are buffered in PDFium's in-memory representation. Call UpdatePage to refresh the rendering cache and SaveAs to persist the changes
Index must fall in the range 0 .. AttachmentCount - 1SaveAs after deleting attachments so the change is persisted
begin
if Pdf1.Active and (Pdf1.AttachmentCount > 0) then
Pdf1.DeleteAttachment(0);
end;