Skip to content

fix: resolve blank slides and broken links in server-side PDF export (#10501) - #10560

Open
Jacopos311 wants to merge 2 commits into
marimo-team:mainfrom
Jacopos311:fix-pdf-slides-export
Open

fix: resolve blank slides and broken links in server-side PDF export (#10501)#10560
Jacopos311 wants to merge 2 commits into
marimo-team:mainfrom
Jacopos311:fix-pdf-slides-export

Conversation

@Jacopos311

@Jacopos311 Jacopos311 commented Aug 14, 2026

Copy link
Copy Markdown

Closes #10501

📝 Summary

This pull request resolves an issue where exporting slide decks containing plots or interactive outputs to PDF resulted in blank slides or broken links.

Specific Changes Made:

  • Server Endpoint (marimo/_server/api/endpoints/export.py): Updated the export_as_pdf handler to collect PNG fallbacks via collect_pdf_png_fallbacks() when include_outputs is enabled and a session view is present. These fallbacks are now successfully passed down via PDFExportRequest, bringing the server-side export flow in line with the CLI flow.
  • Virtual File Inlining (marimo/_export/exporter.py): Added _inline_virtual_files_in_notebook() to resolve ./@file/... virtual file references into inline data URIs inside notebook cell outputs prior to nbconvert processing. This ensures assets load correctly when rendered locally via file:// URIs.
  • Playwright Dependency Check (marimo/_export/exporter.py): Added an explicit DependencyManager.playwright.require() check inside _export_slides_as_pdf() to ensure a clean, user-friendly error message if Playwright/Chromium binaries are missing, instead of a raw ModuleNotFoundError.
  • Tests (tests/_export/test_exporter.py): Added dedicated unit tests covering slides PDF export with PNG fallbacks and virtual file inlining behavior.

📋 Pre-Review Checklist

✅ Merge Checklist

  • I have read the contributor guidelines.
  • Documentation has been updated where applicable, including docstrings for API changes.
  • Tests have been added for the changes made.

@vercel

vercel Bot commented Aug 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview Aug 15, 2026 12:18am

Request Review

@github-actions

github-actions Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@Jacopos311

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@Jacopos311

Copy link
Copy Markdown
Author

recheck

@Jacopos311
Jacopos311 force-pushed the fix-pdf-slides-export branch from f795e84 to d8063c6 Compare August 15, 2026 00:16
@Jacopos311

Copy link
Copy Markdown
Author

recheck

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.

Exporting slides including plots to PDF generates broken links

1 participant