Update app.py
Browse files
app.py
CHANGED
|
@@ -237,11 +237,9 @@ def generate_pdf_report(original_img: Image.Image, mask: np.ndarray, overlay: Im
|
|
| 237 |
pdf.set_font("helvetica", "I", 10)
|
| 238 |
pdf.cell(text="This report was generated by DR Analysis System", new_x="LMARGIN", new_y="NEXT", align='C')
|
| 239 |
|
| 240 |
-
# Get PDF as bytes
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
return pdf_output.encode('latin1')
|
| 244 |
-
return pdf_output
|
| 245 |
|
| 246 |
except Exception as e:
|
| 247 |
st.error(f"PDF generation failed: {str(e)}")
|
|
|
|
| 237 |
pdf.set_font("helvetica", "I", 10)
|
| 238 |
pdf.cell(text="This report was generated by DR Analysis System", new_x="LMARGIN", new_y="NEXT", align='C')
|
| 239 |
|
| 240 |
+
# Get PDF as bytes
|
| 241 |
+
pdf_bytes = pdf.output(dest='S').encode('latin1')
|
| 242 |
+
return pdf_bytes
|
|
|
|
|
|
|
| 243 |
|
| 244 |
except Exception as e:
|
| 245 |
st.error(f"PDF generation failed: {str(e)}")
|