Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -108,19 +108,19 @@ if uploaded_file is not None:
|
|
| 108 |
fig = generate_timeline(cv_type, education_level, score)
|
| 109 |
st.pyplot(fig)
|
| 110 |
|
|
|
|
| 111 |
# --- PDF Download Button ---
|
| 112 |
st.subheader("Download Report")
|
| 113 |
-
pdf = generate_pdf_report(cv_type, education_level, score, score_breakdown, certs, edu, visa, advice, jobs, fig)
|
| 114 |
|
| 115 |
-
# Generate PDF
|
| 116 |
-
|
| 117 |
-
pdf.output(pdf_buffer)
|
| 118 |
-
pdf_buffer.seek(0)
|
| 119 |
|
|
|
|
| 120 |
st.download_button(
|
| 121 |
label="📄 Download CV Analysis Report (PDF)",
|
| 122 |
-
data=
|
| 123 |
file_name="cv_analysis_report.pdf",
|
| 124 |
mime="application/pdf"
|
| 125 |
)
|
| 126 |
|
|
|
|
|
|
| 108 |
fig = generate_timeline(cv_type, education_level, score)
|
| 109 |
st.pyplot(fig)
|
| 110 |
|
| 111 |
+
# --- PDF Download Button ---
|
| 112 |
# --- PDF Download Button ---
|
| 113 |
st.subheader("Download Report")
|
|
|
|
| 114 |
|
| 115 |
+
# Generate the PDF as a string
|
| 116 |
+
pdf_bytes = generate_pdf_report(cv_type, education_level, score, score_breakdown, certs, edu, visa, advice, jobs, fig).output(dest='S').encode('latin1')
|
|
|
|
|
|
|
| 117 |
|
| 118 |
+
# Display a single download button
|
| 119 |
st.download_button(
|
| 120 |
label="📄 Download CV Analysis Report (PDF)",
|
| 121 |
+
data=pdf_bytes,
|
| 122 |
file_name="cv_analysis_report.pdf",
|
| 123 |
mime="application/pdf"
|
| 124 |
)
|
| 125 |
|
| 126 |
+
|