
Security News
Software Engineering Daily Podcast: Feross on AI, Open Source, and Supply Chain Risk
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.
streamlit-pdf
Advanced tools
A lightweight Streamlit feature that seamlessly displays PDF files in your apps, allowing for simple, responsive, and clean document viewing with minimal effort.
pip install streamlit[pdf]
Ensure you have Streamlit installed:
Here's how to display a PDF file in your Streamlit app:
import streamlit as st
# Display PDF from URL
st.pdf("https://example.com/document.pdf")
# Display with custom height
st.pdf("path/to/document.pdf", height=600)
# Display uploaded file
uploaded_file = st.file_uploader("Choose a PDF file", type="pdf")
if uploaded_file is not None:
st.pdf(uploaded_file)
st.pdf(data, height=600)data (str | Path | bytes | BytesIO): The PDF file to show. This can be one of the following:
"https://example.com/doc.pdf")"./documents/sample.pdf")open or an UploadedFile returned by st.file_uploaderheight (int, optional): Height of the PDF viewer in pixels. Default: 600
import streamlit as st
st.title("PDF Viewer Example")
# Display a PDF from URL
st.pdf("https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf")
import streamlit as st
st.title("Upload and View PDF")
uploaded_file = st.file_uploader("Choose a PDF file", type="pdf")
if uploaded_file is not None:
st.pdf(uploaded_file)
import streamlit as st
# Display PDF with specific height
st.pdf("document.pdf", height=800)
# Display PDF with default height
st.pdf("document.pdf")
import streamlit as st
with open("document.pdf", "rb") as file:
st.pdf(file.read(), height=700)
Feel free to file issues in our Streamlit Repository.
Contributions are welcome 🚀, however, please inform us before building a feature.
Prerequisites:
uv venv .venv
source .venv/bin/activate
uv pip install -e '.[with-streamlit]' .
cd streamlit_pdf/frontend && npm install
npm run build
npm run dev
FAQs
A Streamlit component for viewing PDF files
We found that streamlit-pdf demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.

Security News
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.