karthikmn commited on
Commit
3770a8d
·
verified ·
1 Parent(s): 4b26bdf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -1,10 +1,9 @@
1
  import os
2
  import gradio as gr
3
- from pdf_to_svg import convert_pdf_to_svg
4
- from svg_editor import apply_transformations
5
- from svg_to_pdf import convert_svg_to_pdf
6
  import datetime
7
- import tempfile
8
 
9
  # Folder paths
10
  INPUT_FOLDER = "./input/"
@@ -52,7 +51,7 @@ def process_pdf(uploaded_file, brightness, text_scale, line_scale, width, height
52
 
53
  except Exception as e:
54
  log_conversion("Failed", input_pdf, SVG_OUTPUT, PDF_OUTPUT)
55
- return str(e)
56
 
57
  # Gradio interface setup
58
  inputs = [
@@ -77,4 +76,4 @@ gr.Interface(
77
  live=True,
78
  title="PDF to Editable SVG and PDF Converter",
79
  description="Upload a PDF to convert it to both an editable SVG and a PDF with transformations applied."
80
- ).launch()
 
1
  import os
2
  import gradio as gr
3
+ from pdf_to_svg import convert_pdf_to_svg # Ensure this function exists
4
+ from svg_editor import apply_transformations # Ensure this function exists
5
+ from svg_to_pdf import convert_svg_to_pdf # Ensure this function exists
6
  import datetime
 
7
 
8
  # Folder paths
9
  INPUT_FOLDER = "./input/"
 
51
 
52
  except Exception as e:
53
  log_conversion("Failed", input_pdf, SVG_OUTPUT, PDF_OUTPUT)
54
+ return f"Error: {e}"
55
 
56
  # Gradio interface setup
57
  inputs = [
 
76
  live=True,
77
  title="PDF to Editable SVG and PDF Converter",
78
  description="Upload a PDF to convert it to both an editable SVG and a PDF with transformations applied."
79
+ ).launch(debug=True)