Created
June 7, 2022 06:53
-
-
Save Lakshmi-1212/44f3edc1bcc57a5e15dc8c3acdcda005 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
def read_file_pypdf(filepath): | |
pdfFileObj = open(filepath,'rb') | |
pdfReader = PyPDF2.PdfFileReader(pdfFileObj) | |
num_pages = pdfReader.numPages | |
text = "" | |
# Read all the pages | |
for pg in range(num_pages): | |
page = pdfReader.getPage(pg) | |
text += page.extractText() | |
return text | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment