gradio-pdf
Easily display PDFs in Gradio
What it is and what it does
gradio_pdf is a custom component that extends Gradio with a PDF display and input element. It wraps PDF rendering into a Gradio component that can be used in interfaces and blocks, accepting a file path and displaying the PDF in the browser. The component supports standard Gradio features like labels, visibility toggling, and event handlers (change and upload events), making it straightforward to integrate PDF handling into document-processing pipelines.
The package depends only on gradio and is designed as a thin wrapper around PDF display. It exposes a PDF component with configurable height, starting_page, and standard Gradio container options. The component preprocesses input as a string (file path) and can be used both as an input to capture user-uploaded PDFs and as an output to display results from backend processing.
Use it for:
- Build a document question-answering interface where users upload a PDF and ask questions about its content.
- Create a form-processing UI that displays a PDF document alongside input fields for data extraction.
- Display generated or processed PDFs as output in a Gradio app without leaving the web interface.
- Prototype invoice or receipt processing workflows with side-by-side PDF and result display.
- Integrate PDF upload and display into scientific or data analysis applications built with Gradio.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a PDF display component for Gradio applications, allowing you to render PDF files in web-based UIs.
Yes, if you are building a Gradio application that needs to display or accept PDFs. The low install friction, permissive license, and straightforward API make it a practical choice for document-centric UIs. The alpha status and 261 days since last release mean you should test it against your specific Gradio version and PDF use cases before relying on it in production, but there are no known vulnerabilities and the core functionality is stable.
Install
gradio-pdf on PyPI
pip
pip install gradio-pdfuv
uv add gradio-pdfpoetry
poetry add gradio-pdfInstalling gradio-pdf
Before you install
Low friction installation with a single runtime dependency on gradio. The package is in alpha status and hasn't been updated in 261 days, so maintenance momentum is limited but the repository remains active and unarchived.
License in practice
Licensed under Apache-2.0 (permissive), so you can use it freely in commercial and open-source projects without significant legal restrictions.
Quickstart
pip install gradio_pdf
import gradio as gr
from gradio_pdf import PDF
demo = gr.Interface(
fn=lambda doc: doc,
inputs=PDF(label="Document"),
outputs="text"
)
if __name__ == "__main__":
demo.launch()
Requires Python >= 3.10
Verify before relying
- Whether the PDF component supports interactive features beyond display (e.g., annotation, form filling, search).
- Performance characteristics when handling large PDF files or batch operations.
- Compatibility with specific gradio versions beyond the stated Python version support.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — gradio |
| Maintenance | aging — 261 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 149,755/month — #10,988 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: gradio_pdf-0.0.24-py3-none-any.whl
Keywords: Document QA, Documents, PDF, gradio, gradio custom component, gradio-template-Fallback
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
gradio-imagesliderA Gradio component that displays two images…
permissive · top 15,000 on PyPI
gradio-rangesliderA Gradio custom component that adds a…
unclear · top 15,000 on PyPI
streamlit-pdfAdds a PDF viewer component to Streamlit apps…
permissive · top 15,000 on PyPI
gradioGradio builds web interfaces for machine…
permissive · top 5,000 on PyPI
streamlit-pdf-viewerStreamlit component that renders PDF documents…
unclear · top 15,000 on PyPI
gradio-clientCalls any Gradio app as a Python API with a…
permissive · top 5,000 on PyPI
hf-gradioA CLI tool for discovering endpoints and…
permissive · top 5,000 on PyPI
sphinx-simplepdfSphinx-SimplePDF is a Sphinx extension that…
permissive · top 15,000 on PyPI
pdf2imageConverts PDF files to PIL Image objects by…
permissive · top 1,000 on PyPI
mkdocs-render-swagger-pluginRenders Swagger and OpenAPI schemas as…
permissive · top 15,000 on PyPI