Created
January 14, 2025 14:54
-
-
Save documentprocessing/f2d97f29c6777c30b094e7c854cd513f to your computer and use it in GitHub Desktop.
Read PDF metadata with PikePDF API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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