Spaces:
Running
Running
Update test.py
Browse files
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.
|
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
|