Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -34,12 +34,12 @@ os.makedirs(PERSIST_DIR, exist_ok=True)
|
|
34 |
# Fixed PDF file path
|
35 |
FIXED_PDF_PATH = os.path.join(DATA_DIR, "saved_pdf.pdf")
|
36 |
|
37 |
-
|
38 |
def displayPDF(file):
|
39 |
with open(file, "rb") as f:
|
40 |
base64_pdf = base64.b64encode(f.read()).decode('utf-8')
|
41 |
-
pdf_display = f'<iframe src="data:application/pdf;base64,{base64_pdf}" width="100%" height="
|
42 |
-
st.markdown(pdf_display, unsafe_allow_html=True)
|
43 |
|
44 |
# Ingest data once on startup
|
45 |
@st.cache_data
|
|
|
34 |
# Fixed PDF file path
|
35 |
FIXED_PDF_PATH = os.path.join(DATA_DIR, "saved_pdf.pdf")
|
36 |
|
37 |
+
# Function to display the PDF
|
38 |
def displayPDF(file):
|
39 |
with open(file, "rb") as f:
|
40 |
base64_pdf = base64.b64encode(f.read()).decode('utf-8')
|
41 |
+
pdf_display = f'<iframe src="data:application/pdf;base64,{base64_pdf}" width="100%" height="480" type="application/pdf"></iframe>'
|
42 |
+
st.markdown(pdf_display, unsafe_allow_html=True)
|
43 |
|
44 |
# Ingest data once on startup
|
45 |
@st.cache_data
|