Update app.py
Browse files
app.py
CHANGED
|
@@ -161,13 +161,13 @@ def main():
|
|
| 161 |
doc = fitz.open(temp_file)
|
| 162 |
highlight_pdf(doc, delete_df)
|
| 163 |
|
| 164 |
-
# Save the highlighted PDF
|
| 165 |
-
|
| 166 |
-
doc.save(
|
| 167 |
-
|
| 168 |
# Display download link for the highlighted PDF
|
| 169 |
st.subheader("Download Highlighted PDF")
|
| 170 |
-
st.markdown(get_download_link(
|
| 171 |
|
| 172 |
# Cleanup: Remove temporary file
|
| 173 |
os.remove(temp_file_path)
|
|
|
|
| 161 |
doc = fitz.open(temp_file)
|
| 162 |
highlight_pdf(doc, delete_df)
|
| 163 |
|
| 164 |
+
# Save the highlighted PDF to a temporary file
|
| 165 |
+
highlighted_temp_path = tempfile.NamedTemporaryFile(suffix=".pdf", delete=False).name
|
| 166 |
+
doc.save(highlighted_temp_path)
|
| 167 |
+
|
| 168 |
# Display download link for the highlighted PDF
|
| 169 |
st.subheader("Download Highlighted PDF")
|
| 170 |
+
st.markdown(get_download_link(highlighted_temp_path, 'Download Highlighted PDF'), unsafe_allow_html=True)
|
| 171 |
|
| 172 |
# Cleanup: Remove temporary file
|
| 173 |
os.remove(temp_file_path)
|