Repository navigation
Print flyer: open a real 5 × 7 in print dialogue - #22
Merged
Merged
Conversation
The print action now renders the same vector scene into a minimal print view whose @page size is 127 x 177.8 mm and calls print(), so the dialogue opens pre-sized and the output stays vector. Before this, the button opened the PDF in a noopener tab (which returns null), so it always fell back to a download. If the pop-up is blocked the PDF is downloaded instead. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #21.
Problem
The Print flyer button opened the PDF with
window.open(url, "_blank", "noopener"). Per spec (and in Chrome) anoopenerwindow returnsnull, so the code always took its "pop-up blocked" branch and downloaded the PDF — the print dialogue never opened.Fix
printFlyer()now builds the same vector scene as the PDF, writes it into a minimal print view and raises the browser's own print dialogue:@page { size: 127mm 177.8mm; margin: 0 }— the dialogue opens at exactly 5 × 7 in, and the artwork stays vector (no bitmap, no resampling).Verification
npx tsc --noEmit,npx eslint .,npm run build— clean.npx vitest run— 151 passed; the new test asserts the print view contains the 5 × 7 in@pagerule, the production host, inline SVG, and thatprint()is called once.