Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -186,18 +186,18 @@ def html_to_pdf(html_content):
|
|
| 186 |
|
| 187 |
html_content = create_pdf_from_markdown_strings(st.session_state.summ_text)
|
| 188 |
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
|
|
|
|
| 186 |
|
| 187 |
html_content = create_pdf_from_markdown_strings(st.session_state.summ_text)
|
| 188 |
|
| 189 |
+
|
| 190 |
+
if html_content:
|
| 191 |
+
pdf_path = html_to_pdf(html_content)
|
| 192 |
+
|
| 193 |
+
with open(pdf_path, "rb") as pdf_file:
|
| 194 |
+
st.download_button(
|
| 195 |
+
label="Download PDF",
|
| 196 |
+
data=pdf_file,
|
| 197 |
+
file_name="converted.pdf",
|
| 198 |
+
mime="application/pdf"
|
| 199 |
+
)
|
| 200 |
+
|
| 201 |
+
# Remove the temporary file
|
| 202 |
+
os.remove(pdf_path)
|
| 203 |
|