cecilemacaire commited on
Commit
c9896ad
·
verified ·
1 Parent(s): 165f08b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -123,7 +123,8 @@ if sentence:
123
  html = generate_html(pictogram_ids)
124
  st.components.v1.html(html, height=500, scrolling=True)
125
 
126
- # Container to hold the download button
127
- pdf_path = generate_pdf(pictogram_ids)
128
- with open(pdf_path, "rb") as pdf_file:
129
- st.download_button(label="Télécharger la traduction en PDF", data=pdf_file, file_name="pictograms.pdf", mime="application/pdf")
 
 
123
  html = generate_html(pictogram_ids)
124
  st.components.v1.html(html, height=500, scrolling=True)
125
 
126
+ if pictogram_ids:
127
+ # Container to hold the download button
128
+ pdf_path = generate_pdf(pictogram_ids)
129
+ with open(pdf_path, "rb") as pdf_file:
130
+ st.download_button(label="Télécharger la traduction en PDF", data=pdf_file, file_name="pictograms.pdf", mime="application/pdf")