Skip to content

Export actually exports: PDF by printing, PPTX as native objects - #17

Merged
richard-epsilla merged 1 commit into
mainfrom
slides-export
Aug 13, 2026
Merged

richard-epsilla merged 1 commit into
mainfrom
slides-export

Conversation

@richard-epsilla

Copy link
Copy Markdown
Contributor

The button was dead — it called the hosted product's endpoint via SL_API, which stopped existing when the app was ported, so the click threw ReferenceError and the catch swallowed it.

PDF prints #/print, which renders through the same components as the canvas: selectable vector text, vector charts, zero bytes of dependency. It waits on a condition derived from the deck rather than a timer, and refuses to print if elements are still missing. Honest cost: it is the system print dialog, so the label says "Print to PDF…".

PPTX maps to native editable text boxes, shapes and tables; only charts/diagrams/SVG embeds rasterise, and the counts are reported. pptxgenjs is a lazy chunk — entry bundle unchanged (verified: zero PptxGenJS/echarts occurrences in the entry).

Role defaults now come from reifyui@0.4.2's exported ROLE_STYLE instead of a second copy.

🤖 Generated with Claude Code

https://claude.ai/code/session_013DCjqvx3L4VKAPnFaPe7YJ

… objects

The button was dead. downloadExport still called the hosted product's
${SL_API}/v1/sl/decks/{id}/export.{kind}, and SL_API stopped existing when the
app was ported — so the click threw ReferenceError on the first line of the
try and the catch turned it into console.error. A silent no-op, and there is no
export service in this deployment for it to have called anyway.

PDF prints #/print. That is not a compromise: it renders through the SAME
components the canvas uses, so text stays selectable vector and charts stay
vector (the chart element already renders SVG). Every library that could
produce a file instead rasterises the slide, costs 120-240KB gzipped, and
looks worse. The honest cost is that it opens the system print dialog — we
cannot name the file or choose the destination — so the menu says
"Print to PDF…", not "download", and the print bar says to keep Margins on
Default because Chrome only honours @page size while it is.

The print surface waits on a condition derived from the deck (how many SVG
roots and highlighted blocks it MUST produce) rather than a fixed timer, and
if they never arrive it does NOT print — it says how many are missing and
offers Print anyway. A timer here either prints empty chart boxes or makes
everyone wait for the slowest imaginable deck.

PPTX maps the deck to native, editable PowerPoint objects: text boxes,
autoshapes, tables. Only what PowerPoint genuinely cannot express — charts,
diagrams, SVG embeds — becomes an image, and the person is told exactly which
and how many. pptxgenjs is imported by that module alone, so it is a lazy
364KB chunk and the entry is unchanged: verified, zero occurrences of
PptxGenJS or echarts in the entry bundle.

Role defaults come from reifyui's exported ROLE_STYLE (0.4.2) rather than a
copy, because a second copy of that table is the divergence this project has
already had to delete once.

Also: highlight.js had no theme loaded at all, so every code element rendered
dark-on-dark — on screen today, and into every PDF.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013DCjqvx3L4VKAPnFaPe7YJ
@richard-epsilla
richard-epsilla merged commit fb5d001 into main Aug 13, 2026
1 check passed
@richard-epsilla
richard-epsilla deleted the slides-export branch August 13, 2026 09:12
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.

1 participant