I want to disable the download button when i display the pdf.
Below is my code.
def show_pdf(file_path):
with open(file_path,"rb") as f:
base64_pdf = base64.b64encode(f.read()).decode('utf-8')
pdf_display = f'<iframe src="data:application/pdf;base64,{base64_pdf}" width="800" height="800" type="application/pdf"></iframe>'
st.markdown(pdf_display, unsafe_allow_html=True)
pdf_url = [pdf_file["download_url"] for pdf_file in pdf_files if pdf_file["name"] == filename + ".pdf"][0]
response = requests.get(pdf_url)
with open("temp.pdf", "wb") as f:
f.write(response.content)
show_pdf("temp.pdf")
I dont want anyone that open this apps to download the pdf that i display. So can we hide the dowload button there as shown below. Please help me.
Thanks.