St.markdown embed PDF not working for streamlit cloud

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: