Spaces:
Sleeping
Sleeping
Commit
路
b442738
1
Parent(s):
454ae00
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
-
import os
|
2 |
-
os.system("pip install pdfplumber")
|
3 |
import gradio as gr
|
|
|
|
|
4 |
import pdfplumber
|
5 |
|
6 |
def pdf_to_xml(pdf_file):
|
@@ -9,7 +9,7 @@ def pdf_to_xml(pdf_file):
|
|
9 |
if pdf_file is None:
|
10 |
raise ValueError("No se recibi贸 ning煤n archivo PDF.")
|
11 |
|
12 |
-
with pdfplumber.open(pdf_file) as pdf:
|
13 |
pdf_text = ""
|
14 |
for page in pdf.pages:
|
15 |
pdf_text += page.extract_text()
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
import os
|
3 |
+
os.system("pip instal pdfplumber")
|
4 |
import pdfplumber
|
5 |
|
6 |
def pdf_to_xml(pdf_file):
|
|
|
9 |
if pdf_file is None:
|
10 |
raise ValueError("No se recibi贸 ning煤n archivo PDF.")
|
11 |
|
12 |
+
with pdfplumber.open(pdf_file.name) as pdf:
|
13 |
pdf_text = ""
|
14 |
for page in pdf.pages:
|
15 |
pdf_text += page.extract_text()
|