Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,7 +24,7 @@ def extract_pdf_text(uploaded_file):
|
|
| 24 |
# Convert the uploaded file into a byte stream
|
| 25 |
pdf_bytes = uploaded_file.read()
|
| 26 |
# Open the byte stream as a PDF document
|
| 27 |
-
doc = fitz.open(
|
| 28 |
text = ""
|
| 29 |
for page in doc:
|
| 30 |
text += page.get_text()
|
|
|
|
| 24 |
# Convert the uploaded file into a byte stream
|
| 25 |
pdf_bytes = uploaded_file.read()
|
| 26 |
# Open the byte stream as a PDF document
|
| 27 |
+
doc = fitz.open(stream=pdf_bytes, filetype="pdf") # Use stream and specify filetype as 'pdf'
|
| 28 |
text = ""
|
| 29 |
for page in doc:
|
| 30 |
text += page.get_text()
|