Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
import os
|
| 2 |
import streamlit as st
|
| 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 |
|
|
@@ -38,10 +37,7 @@ def main():
|
|
| 38 |
f.write(uploaded_file.read())
|
| 39 |
st.success(f"File uploaded: {uploaded_file.name}")
|
| 40 |
|
| 41 |
-
# User controls for
|
| 42 |
-
brightness = st.slider("Brightness (0.5 to 5.0)", 0.5, 5.0, 1.0, step=0.5)
|
| 43 |
-
text_scale = st.slider("Text Size Scale (0.5 to 2.0)", 0.5, 2.0, 1.0, step=0.1)
|
| 44 |
-
line_scale = st.slider("Line Thickness Scale (0.5 to 5.0)", 0.5, 5.0, 1.0, step=0.5)
|
| 45 |
width = st.number_input("Width (in inches)", value=8.0, step=0.1)
|
| 46 |
height = st.number_input("Height (in inches)", value=11.0, step=0.1)
|
| 47 |
|
|
@@ -51,13 +47,10 @@ def main():
|
|
| 51 |
# Step 1: Convert PDF to SVG
|
| 52 |
convert_pdf_to_svg(input_pdf, SVG_OUTPUT, width, height)
|
| 53 |
|
| 54 |
-
# Step 2:
|
| 55 |
-
apply_transformations(SVG_OUTPUT, brightness, text_scale, line_scale)
|
| 56 |
-
|
| 57 |
-
# Step 3: Convert SVG to PDF
|
| 58 |
convert_svg_to_pdf(SVG_OUTPUT, PDF_OUTPUT)
|
| 59 |
|
| 60 |
-
# Step
|
| 61 |
log_conversion("Success", input_pdf, SVG_OUTPUT, PDF_OUTPUT)
|
| 62 |
|
| 63 |
# Provide download links
|
|
|
|
| 1 |
import os
|
| 2 |
import streamlit as st
|
| 3 |
from pdf_to_svg import convert_pdf_to_svg
|
|
|
|
| 4 |
from svg_to_pdf import convert_svg_to_pdf
|
| 5 |
import datetime
|
| 6 |
|
|
|
|
| 37 |
f.write(uploaded_file.read())
|
| 38 |
st.success(f"File uploaded: {uploaded_file.name}")
|
| 39 |
|
| 40 |
+
# User controls for dimensions
|
|
|
|
|
|
|
|
|
|
| 41 |
width = st.number_input("Width (in inches)", value=8.0, step=0.1)
|
| 42 |
height = st.number_input("Height (in inches)", value=11.0, step=0.1)
|
| 43 |
|
|
|
|
| 47 |
# Step 1: Convert PDF to SVG
|
| 48 |
convert_pdf_to_svg(input_pdf, SVG_OUTPUT, width, height)
|
| 49 |
|
| 50 |
+
# Step 2: Convert SVG to PDF
|
|
|
|
|
|
|
|
|
|
| 51 |
convert_svg_to_pdf(SVG_OUTPUT, PDF_OUTPUT)
|
| 52 |
|
| 53 |
+
# Step 3: Log the process
|
| 54 |
log_conversion("Success", input_pdf, SVG_OUTPUT, PDF_OUTPUT)
|
| 55 |
|
| 56 |
# Provide download links
|