{"id":23107,"library":"gradio-pdf","title":"Gradio PDF","description":"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.","status":"active","version":"0.0.24","language":"python","source_language":"en","source_url":"https://github.com/operegrine/gradio-pdf","tags":["gradio","pdf","visualization","component"],"install":[{"cmd":"pip install gradio-pdf","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"Required; gradio-pdf is a Gradio component","package":"gradio","optional":false},{"reason":"Used internally for text extraction","package":"pypdf2","optional":false}],"imports":[{"note":"Correct class name is PDF (uppercase), not Pdf.","wrong":"from gradio_pdf import Pdf","symbol":"PDF","correct":"from gradio_pdf import PDF"}],"quickstart":{"code":"import gradio as gr\nfrom gradio_pdf import PDF\n\ndef greet(name):\n    return f\"Hello {name}!\"\n\nwith gr.Blocks() as demo:\n    name = gr.Textbox(label=\"Name\")\n    output = gr.Textbox(label=\"Output\")\n    greet_btn = gr.Button(\"Greet\")\n    greet_btn.click(fn=greet, inputs=name, outputs=output)\n\ndemo.launch()","lang":"python","description":"Simple Gradio app with PDF component (placeholder; see official docs for full PDF usage)."},"warnings":[{"fix":"Use `from gradio_pdf import PDF` (capital 'PDF').","message":"The import path changed from `gradio_pdf import Pdf` to `gradio_pdf import PDF` in version 0.0.22. Old code will raise ImportError.","severity":"breaking","affected_versions":">=0.0.22"},{"fix":"Place the PDF component inside `gr.Blocks()` as `PDF(...)`, not `PDF().render()`.","message":"The `render` method was deprecated in v0.0.20 and removed in v0.0.22. Use the component directly in Blocks.","severity":"deprecated","affected_versions":">=0.0.20"},{"fix":"Always pass a string path or URL: `PDF(value='/path/to/file.pdf')`.","message":"The `value` parameter expects a file path or URL as a string, not a file object. Passing a file object may cause silent failure.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install gradio-pdf`. Note the hyphen in the package name but underscore in imports.","cause":"Package not installed or installed with wrong name.","error":"ModuleNotFoundError: No module named 'gradio_pdf'"},{"fix":"Use `from gradio_pdf import PDF` (uppercase).","cause":"The class name changed from 'Pdf' to 'PDF' in version 0.0.22.","error":"ImportError: cannot import name 'Pdf' from 'gradio_pdf'"},{"fix":"Upgrade to latest version: `pip install --upgrade gradio-pdf`. Then use `from gradio_pdf import PDF`.","cause":"Old version (<0.0.22) used 'Pdf' instead of 'PDF'. Or the import statement is incorrect.","error":"AttributeError: module 'gradio_pdf' has no attribute 'PDF'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}