{"library":"streamlit-pdf-viewer","title":"Streamlit PDF Viewer","type":"library","description":"streamlit-pdf-viewer is an active Streamlit component designed for visualizing and manipulating PDF documents directly within Streamlit applications. It currently stands at version 0.0.28, with a consistent release cadence, frequently adding new features like scroll behavior, zoom controls, and annotation capabilities. The library leverages pdf.js for rendering and supports annotations, text rendering, and various display options.","language":"python","status":"active","last_verified":"Sun May 17","install":{"commands":["pip install streamlit-pdf-viewer"],"cli":null},"imports":["from streamlit_pdf_viewer import pdf_viewer"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":null,"github":"https://github.com/lfoppiano/streamlit-pdf-viewer","docs":null,"changelog":null,"pypi":"https://pypi.org/project/streamlit-pdf-viewer/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"import streamlit as st\nfrom streamlit_pdf_viewer import pdf_viewer\nimport os\n\nst.set_page_config(layout=\"wide\")\n\n# Example 1: Display a PDF from a URL\nst.subheader(\"PDF from URL\")\npdf_viewer(\"https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf\", width=700)\n\n# Example 2: Display an uploaded PDF file\nst.subheader(\"Upload and View PDF\")\n\n# Initialize session state for the uploaded file to persist across reruns\nif 'uploaded_pdf_file' not in st.session_state:\n    st.session_state.uploaded_pdf_file = None\n\nuploaded_file = st.file_uploader(\"Choose a PDF file\", type=(\"pdf\"), key=\"pdf_uploader\")\n\nif uploaded_file is not None:\n    st.session_state.uploaded_pdf_file = uploaded_file.getvalue()\n\nif st.session_state.uploaded_pdf_file is not None:\n    pdf_viewer(st.session_state.uploaded_pdf_file, width=700, height=600)\nelse:\n    st.info(\"Please upload a PDF file to view.\")","lang":"python","description":"This quickstart demonstrates how to display a PDF from a URL and how to upload and display a PDF file using `st.file_uploader`, ensuring the uploaded file persists across Streamlit reruns with `st.session_state`.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-17","installed_version":"0.0.29","pypi_latest":"0.0.29","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":15.2,"avg_import_s":1.36,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"streamlit-pdf-viewer","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"noisy","install_time_s":null,"import_time_s":1.5,"mem_mb":24.8,"disk_size":"453.8M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"streamlit-pdf-viewer","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"noisy","install_time_s":16.1,"import_time_s":0.65,"mem_mb":20,"disk_size":"423M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"streamlit-pdf-viewer","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"noisy","install_time_s":null,"import_time_s":2,"mem_mb":26.6,"disk_size":"474.5M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"streamlit-pdf-viewer","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"noisy","install_time_s":14.9,"import_time_s":1.07,"mem_mb":22,"disk_size":"443M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"streamlit-pdf-viewer","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"noisy","install_time_s":null,"import_time_s":2.03,"mem_mb":26.2,"disk_size":"458.3M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"streamlit-pdf-viewer","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"noisy","install_time_s":13.9,"import_time_s":1.26,"mem_mb":21.3,"disk_size":"427M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"streamlit-pdf-viewer","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"noisy","install_time_s":null,"import_time_s":1.87,"mem_mb":26.5,"disk_size":"457.0M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"streamlit-pdf-viewer","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"noisy","install_time_s":13.9,"import_time_s":1.35,"mem_mb":21.9,"disk_size":"425M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"streamlit-pdf-viewer","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"noisy","install_time_s":null,"import_time_s":1.29,"mem_mb":19.8,"disk_size":"438.5M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"streamlit-pdf-viewer","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"noisy","install_time_s":17.3,"import_time_s":0.58,"mem_mb":15.1,"disk_size":"416M"}]}}