Created
January 11, 2021 07:41
-
-
Save haider11234/b0009a8ea029d628a026fd73de413a54 to your computer and use it in GitHub Desktop.
This file contains 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
from PyPDF2 import PdfFileReader | |
pdf_file=open("sample.pdf", 'rb'): | |
pdf = PyPDF2.PdfFileReader(pdf_file) | |
information = pdf.getDocumentInfo() | |
number_of_pages = pdf.getNumPages() | |
info = f""" | |
Information about {pdf_path}: | |
Author: {information.author} | |
Creator: {information.creator} | |
Producer: {information.producer} | |
Subject: {information.subject} | |
Title: {information.title} | |
Number of pages: {number_of_pages} | |
""" | |
print(info) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment