Delete an embedded file attachment from a document
Source:R/attachment_authoring.R
pdf_attachment_delete.RdRemoves the attachment's entry from the document's /EmbeddedFiles
name tree. Wraps FPDFDoc_DeleteAttachment. The handle becomes
closed (subsequent reads / writes through it error cleanly);
indexes of any later attachments shift down by one in PDFium's
internal list — re-fetch via pdf_attachments() if you held
other handles past this point.
Arguments
- att
A
pdfium_attachmentfrompdf_attachments()orpdf_attachment_new(). Parent doc must be readwrite.
Details
Note: PDFium's delete only removes the name-tree pointer; the
underlying /EmbeddedFile object may still occupy bytes in the
saved PDF. This matches FPDFDoc_DeleteAttachment's documented
behaviour.