suredream commited on
Commit
f0edcae
1 Parent(s): a42ddcc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -15,16 +15,16 @@ PDF_HTML_iframe_template = (
15
  """<iframe src="{pdf_url}" width="100%" height="800"></iframe>"""
16
  )
17
 
18
- def display_PDF(st, pdf_url='https://huggingface.co/spaces/suredream/actoolv2/resolve/main/due-diligence-check-example.pdf'):
19
  # /Users/junxiong/Documents/aire/acToolV2/due-diligence-check-example.pdf
20
- # pdf_file = open(pdf_file, 'rb')
21
- # base64_pdf = base64.b64encode(pdf_file.read()).decode('utf-8')
22
- # pdf_display = f'<embed src="data:application/pdf;base64,{base64_pdf}" width="700" height="1000" type="application/pdf">'
23
- # st.markdown(pdf_display, unsafe_allow_html=True)
24
- pdf_content = PDF_HTML_iframe_template.format(
25
- pdf_url=pdf_url
26
- )
27
- st.markdown(pdf_content, unsafe_allow_html=True)
28
 
29
 
30
  # import matplotlib.pyplot as plt
@@ -144,7 +144,7 @@ with left:
144
  with proforma_section:
145
  pdf_container = st.container()
146
  with pdf_container:
147
- display_PDF(st, pdf_url='https://huggingface.co/spaces/suredream/actoolv2/resolve/main/proforma-example.pdf')
148
 
149
 
150
  with right:
 
15
  """<iframe src="{pdf_url}" width="100%" height="800"></iframe>"""
16
  )
17
 
18
+ def display_PDF(st, pdf_url='proforma-example.pdf'):
19
  # /Users/junxiong/Documents/aire/acToolV2/due-diligence-check-example.pdf
20
+ pdf_file = open(pdf_file, 'rb')
21
+ base64_pdf = base64.b64encode(pdf_file.read()).decode('utf-8')
22
+ pdf_display = f'<embed src="data:application/pdf;base64,{base64_pdf}" width="700" height="1000" type="application/pdf">'
23
+ st.markdown(pdf_display, unsafe_allow_html=True)
24
+ # pdf_content = PDF_HTML_iframe_template.format(
25
+ # pdf_url=pdf_url
26
+ # )
27
+ # st.markdown(pdf_content, unsafe_allow_html=True)
28
 
29
 
30
  # import matplotlib.pyplot as plt
 
144
  with proforma_section:
145
  pdf_container = st.container()
146
  with pdf_container:
147
+ display_PDF(st, pdf_url='proforma-example.pdf')
148
 
149
 
150
  with right: