Returns the decompressed file contents of the attachment at
attachment_index (1-based, as listed by pdf_attachments()).
Wraps FPDFAttachment_GetFile.
Arguments
- doc
A
pdfium_docfrompdf_doc_open(), or a character path.- attachment_index
One-based index of the attachment in the document's attachment table.
Details
Use the returned raw vector directly with
writeBin() to save the embedded file to disk without
re-encoding, or pass it to a downstream parser
(e.g. xml2::read_xml(rawToChar(bytes)) for XML attachments).