Registry / web-framework / gradio-pdf

gradio-pdf

JSON →
library0.0.24pypypi✓ verified 84d ago

Gradio component to display PDF files and extract text within Gradio apps. Currently at version 0.0.24, with a pre-1.0 release cadence. Requires Python >=3.10.

pip install gradio-pdf
INSTALL
IMPORT
SIG · GRADIO-PDF
G
gradio-pdf
web-frameworkpythonv0.0.24
Install
18.0s avg
Import
11600ms
Disk
338MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.24 · 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 9.770s · 326.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 18.0s · import 8.790s · 320MB
338MB installed
● package 338MB
Code
Verified usage

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

PDF
from gradio_pdf import PDF
from gradio_pdf import Pdf
Correct class name is PDF (uppercase), not Pdf.

Simple Gradio app with PDF component (placeholder; see official docs for full PDF usage).

import gradio as gr from gradio_pdf import PDF def greet(name): return f"Hello {name}!" with gr.Blocks() as demo: name = gr.Textbox(label="Name") output = gr.Textbox(label="Output") greet_btn = gr.Button("Greet") greet_btn.click(fn=greet, inputs=name, outputs=output) demo.launch()
Debug
Known issues
breakingThe import path changed from `gradio_pdf import Pdf` to `gradio_pdf import PDF` in version 0.0.22. Old code will raise ImportError.
fix
Use `from gradio_pdf import PDF` (capital 'PDF').
affects: >=0.0.22
deprecatedThe `render` method was deprecated in v0.0.20 and removed in v0.0.22. Use the component directly in Blocks.
fix
Place the PDF component inside `gr.Blocks()` as `PDF(...)`, not `PDF().render()`.
affects: >=0.0.20
gotchaThe `value` parameter expects a file path or URL as a string, not a file object. Passing a file object may cause silent failure.
fix
Always pass a string path or URL: `PDF(value='/path/to/file.pdf')`.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'gradio_pdf'
Package not installed or installed with wrong name.
fix
Run `pip install gradio-pdf`. Note the hyphen in the package name but underscore in imports.
ImportError: cannot import name 'Pdf' from 'gradio_pdf'
The class name changed from 'Pdf' to 'PDF' in version 0.0.22.
fix
Use `from gradio_pdf import PDF` (uppercase).
AttributeError: module 'gradio_pdf' has no attribute 'PDF'
Old version (<0.0.22) used 'Pdf' instead of 'PDF'. Or the import statement is incorrect.
fix
Upgrade to latest version: `pip install --upgrade gradio-pdf`. Then use `from gradio_pdf import PDF`.
Upgrade
Version history
0.0.24latest on PyPI · released Nov 26, 2025
Audit
Dependencies
gradiorequiredRequired; gradio-pdf is a Gradio component
pypdf2requiredUsed internally for text extraction
Agent activity
10 hits · last 30 days
node
10
Resources
gradio-pdf — pip install gradio-pdf · libregistry