PDF attachments carry a /Params dictionary with metadata about
the embedded file (size, modification date, checksums, MIME
type, custom keys). pdf_attachments() surfaces the common
entries; this function reads an arbitrary key. Wraps
FPDFAttachment_HasKey + FPDFAttachment_GetValueType +
FPDFAttachment_GetStringValue.
Arguments
- doc
A
pdfium_docfrompdf_doc_open(), or a character path.- attachment_index
One-based index into the attachment list.
- key
The attachment-dict key as a single non-empty character string (e.g.
"Subtype","AFRelationship").- password
Optional password for encrypted PDFs when
docis a path. Ignored whendocis already an openpdfium_doc.
Value
A list:
has_key(logical) —TRUEwhen the attachment dict contains the key.value_type(integer) — PDFium'sFPDF_OBJECT_*enum value (0=unknown,1=boolean,2=number,3=string,4=name, ...).NAwhen the key is absent.value(character) — the string / name value;NA_character_when the value is not string-typed.
Details
Only string- and name-typed values are returned as character
scalars. For numeric / boolean / dict values the function
reports has_key = TRUE and value_type accordingly but
value = NA_character_ (use pdf_attachments() for the
structured size/date/checksum readouts).