Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save documentprocessing/f2d97f29c6777c30b094e7c854cd513f to your computer and use it in GitHub Desktop.
Save documentprocessing/f2d97f29c6777c30b094e7c854cd513f to your computer and use it in GitHub Desktop.
Read PDF metadata with PikePDF API
import pikepdf
# Load the PDF file
file_path = "example.pdf"
with pikepdf.Pdf.open(file_path) as pdf:
# Access the document metadata
metadata = pdf.docinfo
# Print each metadata key-value pair
print("PDF Metadata:")
for key, value in metadata.items():
print(f"{key}: {value}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment