Created
January 11, 2021 06:28
-
-
Save haider11234/5b10f1c22ae3b176edebbbc750437c8f 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
# importing modules | |
import PyPDF2 | |
pdfFileObj = open('file.pdf', 'rb') | |
# creating a pdf reader object | |
pdfReader = PyPDF2.PdfFileReader(pdfFileObj) | |
pagecount=pdfReader.numPages | |
i=0 | |
while i < pagecount: | |
pageObj = pdfReader.getPage(i) | |
print(pageObj.extractText()) | |
i+=1 | |
pdfFileObj.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment