Skip to content

Create a new PDF object from scratch #1473

@angea

Description

@angea

Is your feature request related to a problem? Please describe.
When I merged documents, I noticed that the /Info dictionary from the trailer is lost.

I noticed it's possible to copy it from the source file:

ref = old.xref_get_key(-1, "Info")[1]
ref_nb = int(ref.split(" ")[0])
info_dict = old.xref_object(ref_nb)

Then add it manually in the trailer of the new file:

new.xref_set_key(-1, "Info", info_dict)

Describe the solution you'd like
Instead of adding it to the trailer, I'd prefer to create a new object for that - like it was initially - but xref_set_keys` doesn't suit my needs.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions