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:
|
Example
st.pdf("https://example.com/sample.pdf") st.pdf("https://example.com/sample.pdf", height=600)
Still have questions?
Our forums are full of helpful information and Streamlit experts.