Skip to content

F and UF values for embedded files #3070

@stefan6419846

Description

@stefan6419846

Explanation

pypdf currently only returns the names of embedded files as provided inside the /Names list. The /F and /UF keys are not available, but used by most of the other applications.

Example file

...
18 0 obj
<</EmbeddedFiles 19 0 R>>
endobj
19 0 obj
<</Names[(þÿINVOICE) 22 0 R]>>
endobj
20 0 obj
<</Length    1592/Type/EmbeddedFile/Subtype/text#2Fxml/Params 21 0 R/Filter/FlateDecode>>stream
...
endstream
endobj
21 0 obj
<</Size 8922/CreationDate(D:20250122113653+01'00')/ModDate(D:20250122113653+01'00')>>
endobj
22 0 obj
<</Type/Filespec/F(factur-x.xml)/EF 23 0 R/Desc()/UF(factur-x.xml)/AFRelationship/Unspecified>>
endobj
...

In this specific case, list(pdf.attachments.keys()) will report INVOICE instead of factur-x.xml.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions