Update app.py
Browse files
app.py
CHANGED
|
@@ -17,6 +17,7 @@ import pandas as pd
|
|
| 17 |
import base64
|
| 18 |
import tempfile
|
| 19 |
import os
|
|
|
|
| 20 |
|
| 21 |
# set page size wide and theme
|
| 22 |
st.set_page_config(layout='wide', initial_sidebar_state='collapsed',)
|
|
@@ -170,6 +171,10 @@ def app2():
|
|
| 170 |
data=PDFbyte,
|
| 171 |
file_name=uploaded_file.name+"_annotated.pdf",
|
| 172 |
mime='application/octet-stream')
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
|
| 174 |
#with open((tempfile.gettempdir()+"/annott.pdf"),"rb") as f:
|
| 175 |
# base64_pdf = base64.b64encode(f.read()).decode('utf-8')
|
|
|
|
| 17 |
import base64
|
| 18 |
import tempfile
|
| 19 |
import os
|
| 20 |
+
import streamlit.components.v1 as components
|
| 21 |
|
| 22 |
# set page size wide and theme
|
| 23 |
st.set_page_config(layout='wide', initial_sidebar_state='collapsed',)
|
|
|
|
| 171 |
data=PDFbyte,
|
| 172 |
file_name=uploaded_file.name+"_annotated.pdf",
|
| 173 |
mime='application/octet-stream')
|
| 174 |
+
|
| 175 |
+
with open((tempfile.gettempdir()+"/annott.pdf"),"rb") as f:
|
| 176 |
+
base64_pdf = base64.b64encode(f.read()).decode('utf-8')
|
| 177 |
+
components.iframe("data:application/pdf;base64,{base64_pdf}" width="800" height="800" type="application/pdf")
|
| 178 |
|
| 179 |
#with open((tempfile.gettempdir()+"/annott.pdf"),"rb") as f:
|
| 180 |
# base64_pdf = base64.b64encode(f.read()).decode('utf-8')
|