st.markdown("""
<embed src="https://storage.googleapis.com/filename.pdf" width="100%" height="1000">
""", unsafe_allow_html=True)
Renders in my dev. But when pushed to production, doest not render, even though inspect element tells me the object is there.
PDF size is 7MB.
Hi @neldivad ,
Thanks for sharing this question!
Have you considered using something like the pdfplumber package to convert the pdf to images then rendering the images on the app using st.image ?
I gave up trying to make it work. I just leave a link to my S3 object and the link opens up a pdf viewer for the content.
def main():
st.info('If the user manual is not being displayed properly here, you may view file at [this link](https://storage.googleapis.com/xxx.pdf)')
st.markdown("""
<embed src="https://storage.googleapis.com/xxx.pdf" width="100%" height="1000">
""", unsafe_allow_html=True)
Thanks for sharing your implementation @neldivad
There’s also a component for displaying PDFs within the app:
Hi all,
I would like to announce that we have released the first version of the streamlit-pdf-viewer. A component to show PDF documents in streamlit.
This component unwraps and shows PDF documents in streamlit and decorates them with annotations.
We are still actively working on it, and we welcome any help such as suggestions, comments, testers and developers
Github: GitHub - lfoppiano/streamlit-pdf-viewer: Streamlit PDF viewer
Demo application: https://structure-vision.strea…
system
Closed
January 7, 2025, 9:44pm
5
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.