Podium PDF renderer
Student Slide PDF generation prints the retained Marp SVG/CSS through an internal Chromium service. The API uses Gotenberg’s HTML conversion endpoint, then retains the returned PDF bytes for preview and download. It does not rerender Markdown, capture video frames, transcribe audio or launch a browser inside the API process.
Configuration
Section titled “Configuration”The Emergent chart declares services.podium-pdf, disabled in the chart baseline
and enabled by infra/helmfile/values/dev/overrides-dev.yaml. It runs the maintained
gotenberg/gotenberg:9.6.0-chromium image, verified against the latest official
release and image manifest on 17 November 2026. The image includes Noto CJK fonts.
Set the API’s PODIUM_PDF_RENDERER_URL to the internal service origin, normally
http://emergent-podium-pdf:3000 for release emergent. The dev Supabase values
provide this setting. A local override that replaces functions.extraEnvVars must
include it too, because Helm replaces arrays. With another release name, use that
release’s service name. A host-run API needs a reachable URL, for example through
an explicitly started port-forward; it cannot resolve cluster Service DNS itself.
Deployment is through the normal Helmfile application process. No database
credentials or source mounts are supplied to the renderer, and it has no public
Gateway route. GET /health is used for its startup/readiness/liveness probes.
The API refuses export with a fixed renderer-unavailable error when the setting is absent or the service is unavailable. This must not prevent normal presentation.
Rendering boundary
Section titled “Rendering boundary”- Only selected Slides from a server-owned snapshot reach the renderer.
- Frozen binding values are inserted as text. Teacher cues and playback controls are omitted. Existing static image/poster references are embedded from retained bytes; additional video posters are not generated.
- Each selected Slide occupies one page with its original width, height, CSS and complete Marp foreignObject background layers, in the selected order.
- External stylesheets/resources and unsupported image references fail export rather than silently producing an incomplete PDF.
- Gotenberg disables JavaScript, URL downloads, webhooks and both public/private HTTP resource loads. Its default file-access deny rule remains in place.
- Requests are bounded to a 40 MiB generated HTML document and a 65-second API
timeout. The renderer’s own request timeout is 60 seconds and concurrency is 2.
Returned bytes must be
application/pdf, begin with%PDF-and fit in 50 MiB.
The exact retained PDF is the authoritative export. A later export is a new artifact; preview/download must not silently regenerate an earlier file.
Validation
Section titled “Validation”Run the focused adapter/print-document tests with the repository’s Bun toolchain:
mise exec -- bun test apps/api/src/features/podium-reviews/pdf-renderer.test.tsIf the developer shell sends loopback requests through an inherited HTTP proxy, clear those proxy variables for the test command. The multipart adapter tests run a local HTTP server.
For visual acceptance, render a representative retained Deck (including Chinese
text, advanced backgrounds and images), check page count/order with pdfinfo and
pdftotext, then inspect PNGs produced by pdftoppm. DOM/unit tests alone cannot
establish Chromium layout or font quality. Keep development artifacts under
tmp/agents/ and do not regenerate delivered teaching kits for this check.
Upstream references: HTML conversion, configuration, release.