Rammohan0504 commited on
Commit
165fd96
·
verified ·
1 Parent(s): 02d19f7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -203,14 +203,19 @@ def build_health_card(profile_image, test_results, summary, patient_name="", pat
203
  </div>
204
 
205
  <div style="display: flex; gap: 15px; justify-content: center; flex-wrap: wrap;">
206
- <button onclick="window.print()" style="padding: 12px 24px; background: linear-gradient(135deg, #4caf50, #45a049); color: white; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px; box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3); transition: all 0.3s;">
207
  📥 Download Report
208
  </button>
209
- <button style="padding: 12px 24px; background: linear-gradient(135deg, #2196f3, #1976d2); color: white; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px; box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);">
210
- 📞 Find Labs Near Me
211
- </button>
212
  </div>
213
  </div>
 
 
 
 
 
 
 
 
214
  """
215
  return html
216
 
 
203
  </div>
204
 
205
  <div style="display: flex; gap: 15px; justify-content: center; flex-wrap: wrap;">
206
+ <button onclick="downloadHealthCard()" style="padding: 12px 24px; background: linear-gradient(135deg, #4caf50, #45a049); color: white; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px; box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3); transition: all 0.3s;">
207
  📥 Download Report
208
  </button>
 
 
 
209
  </div>
210
  </div>
211
+ <script>
212
+ function downloadHealthCard() {{
213
+ const link = document.createElement('a');
214
+ link.href = '{pdf_filepath}';
215
+ link.download = 'Health_Report.pdf';
216
+ link.click();
217
+ }}
218
+ </script>
219
  """
220
  return html
221