Skip to main content

Module embedded_files

Module embedded_files 

Source
Expand description

PDF embedded files (file attachments).

PDFs can carry arbitrary file attachments via the catalog’s /Names /EmbeddedFiles name tree (PDF 1.4+) or as the /FS target of a /FileAttachment annotation. This module exposes the document-level table; the per-annotation form is reachable via Annotation’s FileAttachmentAnnotation.

Each entry is a file specification describing the attachment (name, description, relationship hint, MIME type, modification dates, byte size) plus a reference to the embedded-file stream. The bytes themselves load on demand via PdfDocument::embedded_file_bytes.

Structs§

EmbeddedFile
One embedded file.

Enums§

AfRelationship
/AFRelationship — relationship of an associated file to the host document, from PDF 2.0 §14.13.

Functions§

decode_embedded_file_stream
Decode the bytes of an embedded-file stream by (obj_num, gen_num).
parse_embedded_files
Walk the catalog’s /Names /EmbeddedFiles name tree and produce a map of every attachment, keyed by the tree’s name.