Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
import gradio as gr
|
2 |
import fitz # PyMuPDF for PDF handling
|
3 |
-
import os
|
4 |
|
5 |
def convert_pdf(input_file, output_format):
|
6 |
"""
|
@@ -13,7 +12,8 @@ def convert_pdf(input_file, output_format):
|
|
13 |
Returns:
|
14 |
Path to the converted file.
|
15 |
"""
|
16 |
-
|
|
|
17 |
|
18 |
output_file_path = f"output.{output_format.split(' ')[0].lower()}"
|
19 |
|
|
|
1 |
import gradio as gr
|
2 |
import fitz # PyMuPDF for PDF handling
|
|
|
3 |
|
4 |
def convert_pdf(input_file, output_format):
|
5 |
"""
|
|
|
12 |
Returns:
|
13 |
Path to the converted file.
|
14 |
"""
|
15 |
+
# Open the PDF file using PyMuPDF (fitz)
|
16 |
+
pdf_document = fitz.open(input_file.name)
|
17 |
|
18 |
output_file_path = f"output.{output_format.split(' ')[0].lower()}"
|
19 |
|