Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/user/metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ writer.add_metadata(
# Save the new PDF to a file
with open("meta-pdf.pdf", "wb") as f:
writer.write(f)

#Access new custom field (while standard fields like Author have primitive analogs and can be accessed like reader.metadata.author, custom fields do not)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. I would have thought that this is obvious, but apparently it is not?

Regarding the changes itself:

  • Please keep a consistent style, id est starting comments with a whitespace, using reader over custom names and using double quotes.
  • What are "primitive analogs"? Why not just use the term property which Python developers should know already?

metareader = PdfReader("meta-pdf.pdf")
print(metareader.metadata['/CustomField'])
```

## Updating metadata
Expand Down