Registry / web-framework / streamlit-pdf

streamlit-pdf

JSON →
library2.0.1pypypi✓ verified 79d ago

A Streamlit custom component that renders PDF files directly in the browser. Version 2.0.1 supports embedded viewing, page navigation, and zoom controls. Maintained by the community with monthly releases.

pip install streamlit-pdf
INSTALL
IMPORT
SIG · STREAMLIT-PDF
S
streamlit-pdf
web-frameworkpythonv2.0.1
Install
1.6s avg
Import
Disk
20MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 22.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 23MB
20MB installed
● package 20MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pdf_viewer
from streamlit_pdf import pdf_viewer
from streamlit_pdf import st_pdf

Minimal example to display a PDF from a URL.

import streamlit as st from streamlit_pdf import st_pdf st.title("PDF Viewer") # Example: load PDF from URL pdf_url = "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf" # Or from local file: open('example.pdf', 'rb') st_pdf(pdf_url, width=700, height=900)
Debug
Known issues
breakingVersion 2.x majorly changed the API. The function `render_pdf` from 1.x is removed. Use `st_pdf` instead.
fix
Replace `from streamlit_pdf import render_pdf` with `from streamlit_pdf import st_pdf`.
affects: <=1.x
gotchaLocal file paths must be passed as bytes or as a string path. If you pass a string URL, it is fetched; if you pass a Path object, it may fail.
fix
Use `open('file.pdf', 'rb').read()` for local files or a string URL.
affects: all
deprecatedThe `height` parameter in version 2.x might be ignored in some Streamlit builds; use CSS styling instead.
fix
Apply custom CSS via `st.markdown` or use Streamlit's `st.columns` to control layout.
affects: 2.0.0 - 2.0.1
Upgrade
Version history
2.0.1latest on PyPI · released Nov 18, 2025
Audit
Dependencies
streamlitrequiredRequired to run the component as a Streamlit app
Agent activity
17 hits · last 30 days
node
16
Resources
streamlit-pdf — pip install streamlit-pdf · libregistry