Omkar008 commited on
Commit
2b51f2b
1 Parent(s): 49820d4

Update test.py

Browse files
Files changed (1) hide show
  1. test.py +1 -1
test.py CHANGED
@@ -126,7 +126,7 @@ async def extract_text_from_pdf(pdf_data):
126
  with io.BytesIO(pdf_data) as pdf_file:
127
  pdf_reader = PyPDF2.PdfReader(pdf_file)
128
  text = ""
129
- for page_num in range(pdf_reader.numPages):
130
  page = pdf_reader.getPage(page_num)
131
  text += page.extract_text()
132
  return text
 
126
  with io.BytesIO(pdf_data) as pdf_file:
127
  pdf_reader = PyPDF2.PdfReader(pdf_file)
128
  text = ""
129
+ for page_num in range(len(pdf_reader.pages)):
130
  page = pdf_reader.getPage(page_num)
131
  text += page.extract_text()
132
  return text