Spaces:
Runtime error
Runtime error
File size: 1,068 Bytes
e30a304 a898358 e30a304 0d9d7ad e30a304 a898358 e30a304 a898358 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
import streamlit as st
import base64
from src.st_helpers import st_setup
if st_setup('Dissertation'):
st.write("# Dissertation")
st.write("The dissertation is delivered as a PDF dcoument. In addition, the submission is supported by a short video giving an overview of the project for orientation.")
st.write("*NOTE - ONLY TEMP FILES RIGHT NOW - THESE WILL BE ADDED WHEN COMPLETE*")
# Provide a button to download the document
with open("img/dissertation.pdf", "rb") as f:
pdf_bytes = f.read()
st.download_button(label="Download dissertation",
data=pdf_bytes,
file_name="dissertation.pdf",
mime='application/octet-stream')
# Also show the document inline
with open("img/dissertation.pdf", "rb") as f:
base64_pdf = base64.b64encode(f.read()).decode('utf-8')
pdf_display = F'<iframe src="data:application/pdf;base64,{base64_pdf}" width="1000" height="1500" type="application/pdf"></iframe>'
st.markdown(pdf_display, unsafe_allow_html=True)
|