Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -231,7 +231,7 @@ def pdf2txt(docs):
|
|
231 |
elif file_extension.lower() == 'pdf':
|
232 |
from PyPDF2 import PdfReader
|
233 |
pdf = PdfReader(BytesIO(file.getvalue()))
|
234 |
-
for page in range(len(
|
235 |
text += pdf.getPage(page).extractText()
|
236 |
except Exception as e:
|
237 |
st.write(f"Error processing file {file.name}: {e}")
|
|
|
231 |
elif file_extension.lower() == 'pdf':
|
232 |
from PyPDF2 import PdfReader
|
233 |
pdf = PdfReader(BytesIO(file.getvalue()))
|
234 |
+
for page in range(len(pdf.pages)):
|
235 |
text += pdf.getPage(page).extractText()
|
236 |
except Exception as e:
|
237 |
st.write(f"Error processing file {file.name}: {e}")
|