markIA23 commited on
Commit
336d0de
·
verified ·
1 Parent(s): 78f5439

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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
- """# 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="600" type="application/pdf"></iframe>'
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