Skip to content

Add PDF rendering support in Streamlit and Quarto reports#184

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/add-pdf-support-in-reports
Draft

Add PDF rendering support in Streamlit and Quarto reports#184
Copilot wants to merge 2 commits into
mainfrom
copilot/add-pdf-support-in-reports

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 29, 2026

VueGen had no support for PDF files as report components. This adds end-to-end PDF rendering: auto-detection from directory scans through to output code generation for both Streamlit and Quarto report types.

Changes

  • report.py: Added PDF to PlotType enum
  • config_manager.py: .pdf files are now auto-detected and configured as plot components with plot_type=pdf
  • streamlit_reportview.py: Generates st.pdf() rendering code — reads bytes from local files or fetches from URLs via requests
  • quarto_reportview.py: Adds _generate_pdf_content() that embeds PDFs via an HTML <iframe> (suitable for HTML/RevealJS output formats)

Example — generated Streamlit code for a local PDF

pdf_file_path = (section_dir / 'path/to/figure.pdf').resolve()
with open(pdf_file_path, 'rb') as pdf_file:
    pdf_data = pdf_file.read()
st.pdf(pdf_data, use_container_width=True)

For URL sources, the file is fetched via requests.get() and the response bytes are passed directly to st.pdf().

Copilot AI linked an issue Apr 29, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add PDF support to visualize figures in reports Add PDF rendering support in Streamlit and Quarto reports Apr 29, 2026
Copilot AI requested a review from enryH April 29, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PDF support

2 participants