From ca6a150ff11c9aee3b417f8a853fd439d81aff09 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Tue, 26 May 2026 15:02:12 -0400 Subject: [PATCH] Deck PDF: override the global single-sheet print lock on html/body MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Verified via headless Chrome + CDP: the live app rendered only 1 PDF page with the slide canvas at ~56% page width and the right side white. Minimal CSS repros produced 3 pages correctly, so the bug was in interaction with the rest of the app's stylesheet. Root cause — base print stylesheet (line 2455): @media print { html, body { width: var(--sheet-w) !important; height: var(--sheet-h) !important; overflow: hidden !important; } } Designed for single-sheet prints (cover / disc / jewel — one physical sheet per design). For deck PDF that's wrong: - width / height pin body to the cover-template sheet dims (the --sheet-w / --sheet-h variables don't get reset for deck mode), so 20in × 11.25in deck pages get clipped to ~11in × 8.5in. The canvas previewing 1920×1080 inside a body locked to a smaller width ends up as a square (height-constrained), filling only ~56% of the actual PDF page width. - overflow: hidden kills the multi-page break-after flow — the second and third .deckPrintPage divs overflow body's height and just get clipped instead of paginated. Fix: deck PDF stylesheet now also overrides html/body to width: auto; height: auto; overflow: visible so the body expands to hold every .deckPrintPage and break-after works. Verified end-to-end with a CDP-driven export of a 3-slide deck: - pdfinfo: 3 pages, 1440x810 pts (20x11.25in) - pdftoppm + visual inspection: each page is 1920x1080 fill, correct background colour, slide text centred at expected position. Yellow slide ONE / blue slide TWO / green slide THREE all render. Co-Authored-By: Claude Opus 4.7 --- src/index.html | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/index.html b/src/index.html index ea80da2..1f121dd 100644 --- a/src/index.html +++ b/src/index.html @@ -14614,6 +14614,17 @@ styleEl.textContent = ` @media print { @page { size: ${fmt(pageW)}in ${fmt(pageH)}in; margin: 0; } + /* The base print stylesheet locks html / body to the cover- + template sheet dims with overflow:hidden so single-sheet + prints don't run off the page. Override that for the deck + exporter — we need the body to expand to hold every + .deckPrintPage and let break-after page-break properly. */ + html, body { + width: auto !important; height: auto !important; + overflow: visible !important; + margin: 0 !important; padding: 0 !important; + background: #fff !important; + } body > *:not(#deckPrintContainer) { display: none !important; } #deckPrintContainer { position: static !important; left: 0 !important; top: 0 !important; display: block !important; } .deckPrintPage {