from streamlit_pdf_viewer import pdf_viewer import streamlit as st def display_pdf(filename='MS4.pdf'): with open(filename, "rb") as file: file.seek(0) pdf = file.read() pdf_viewer(input=pdf, width=700) def download_pdf_button(filename='MS4.pdf'): with open(filename, "rb") as file: file.seek(0) pdf = file.read() st.download_button( label="Download PDF", data=pdf, file_name=filename, mime="application/pdf", type="primary", use_container_width=True, ) if __name__ == "__main__": display_pdf()