Set the raw bytes of an embedded file attachment
Source:R/attachment_authoring.R
pdf_attachment_set_data.RdReplaces the attachment's embedded file data with the given raw
bytes. Wraps FPDFAttachment_SetFile. The attachment's
CreationDate and checksum dictionary entries are automatically
updated; all other entries (including the MIME Subtype and
the Desc you may have set with
pdf_attachment_set_dict_value()) are cleared by PDFium during
the write — set those entries after this call.
Arguments
- att
A
pdfium_attachmentfrompdf_attachments()orpdf_attachment_new(). Parent doc must be readwrite.- data
A raw vector of file bytes. To attach a UTF-8 text payload, pass
charToRaw(enc2utf8(text)).
Details
Use this immediately after pdf_attachment_new() to populate a
fresh attachment, or to update the file contents of an existing
one.
See also
pdf_attachment_data() for the read side.