Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Read Metadata | Manipulating and Combining PDFs
Manipulating and Combining PDFs

book
Read Metadata

metadata is a PyPDF2 attribute that allows developers to extract or modify the metadata of a PDF file. It's useful for automating the process of extracting information from PDF documents, such as the author, title, or creation date. With metadata, developers can also modify the metadata of a PDF document to update information or add new metadata to the file.

Tehtävä

Swipe to start coding

  1. Read a PDF file called "example.pdf";
  2. Access to the metadata of your pdf;
  3. Print the author and creator of the pdf.

Ratkaisu

from PyPDF2 import PdfReader

reader = PdfReader("example.pdf")

meta = reader.metadata

print(len(reader.pages))

# All of the following could be None!
print(meta.author)
print(meta.creator)
print(meta.producer)
print(meta.subject)
print(meta.title)

Congratulations on finishing your project about handling PDFs in Python! It's no small feat to work with such complex and often challenging file formats, so kudos to you for persevering and completing your work. Keep up the great work, and I can't wait to see what you'll accomplish next!

Mark tasks as Completed
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 1. Luku 9
AVAILABLE TO ULTIMATE ONLY
some-alt