suredream commited on
Commit
11100ba
1 Parent(s): 6f1f43c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
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_file='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='due-diligence-check-exmaple.pdf'
26
- # )
27
- # st.markdown(pdf_content, unsafe_allow_html=True)
28
 
29
 
30
  # import matplotlib.pyplot as plt
 
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