Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import json
|
2 |
import gradio as gr
|
3 |
-
from pdfminer.high_level import extract_pages
|
4 |
from pdfminer.layout import LTTextBoxHorizontal, LTFigure, LTImage
|
5 |
import os
|
6 |
import io
|
@@ -24,7 +24,7 @@ def parse_pdf(pdf_file, output_format, progress=gr.Progress()):
|
|
24 |
"""
|
25 |
try:
|
26 |
with open(pdf_file, 'rb') as file:
|
27 |
-
pages = extract_pages(file)
|
28 |
text = ""
|
29 |
tables = []
|
30 |
images = []
|
|
|
1 |
import json
|
2 |
import gradio as gr
|
3 |
+
from pdfminer.high_level import extract_pages, extract_text
|
4 |
from pdfminer.layout import LTTextBoxHorizontal, LTFigure, LTImage
|
5 |
import os
|
6 |
import io
|
|
|
24 |
"""
|
25 |
try:
|
26 |
with open(pdf_file, 'rb') as file:
|
27 |
+
pages = list(extract_pages(file)) # Convert generator to list
|
28 |
text = ""
|
29 |
tables = []
|
30 |
images = []
|