st.pdf
Display a PDF viewer.
Important
You must install streamlit-pdf to use this command. You can install it as an extra with Streamlit:
pip install streamlit[pdf]
| Function signature[source] | |
|---|---|
st.pdf(data, *, height=500, key=None) | |
| Parameters | |
data (str, Path, BytesIO, or bytes) | The PDF file to show. This can be one of the following:
|
height (int or "stretch") | The height of the PDF viewer. This can be one of the following:
|
Examples
st.pdf("https://example.com/sample.pdf")
st.pdf("https://example.com/sample.pdf", height=600)
Tip
Want a new st.pdf feature or found a bug? Browse open issues and react with a 👍 on the initial post of the ones that matter to you. Your votes help us prioritize what to work on next.
Still have questions?
Our forums are full of helpful information and Streamlit experts.