One file attachment carried inside a PDF — an entry of the catalog's
/Names /EmbeddedFiles name tree.
Obtain the list with PdfElixide.Document.embedded_files/1 or
PdfElixide.Editor.embedded_files/1, and add one with
PdfElixide.Editor.embed_file/4.
Memory
The bytes are on the struct rather than behind a handle, so a document with large attachments costs their full size on every call. Both listing functions decode every attachment together, so as the call returns the bytes exist twice — natively and as the binaries encoded from them.
Fields
:name— the attachment's file name, from/UFif readable and/Fotherwise."attachment"when the entry names itself in neither.:data— the decoded file contents.:description— the entry's/Desc, ornil.:mime_type— the media type the attachment declares ("text/csv"), ornil. Attachments written by this library declare none; see Attachments.:relationship— how the attachment relates to the document, seerelationship/0, ornilwhen the entry declares none or declares one outside that set.:size— the size in bytes the entry declares, ornil. A producer writes it alongside the data rather than from it, so it can disagree withbyte_size(data); compare the two if that matters.:checksum— the raw MD5 digest of the file contents the entry declares, ornil. Unverified, and MD5 is not a defence against deliberate tampering.:created,:modified— the entry's declared timestamps, as raw PDF date strings ("D:20260101120000+00'00'"), ornil.
Summary
Types
How an attachment relates to the document that carries it (PDF 2.0
/AFRelationship).
Types
@type relationship() ::
:source
| :data
| :alternative
| :supplement
| :encrypted_payload
| :form_data
| :schema
| :unspecified
How an attachment relates to the document that carries it (PDF 2.0
/AFRelationship).
:unspecified is a declared absence of a relationship, which is not the same
as the field being absent — that reads as nil.
@type t() :: %PdfElixide.Document.EmbeddedFile{ checksum: binary() | nil, created: String.t() | nil, data: binary(), description: String.t() | nil, mime_type: String.t() | nil, modified: String.t() | nil, name: String.t(), relationship: relationship() | nil, size: non_neg_integer() | nil }