A printed poster is its own document, never an image of itself: the same vector sheet prints with its own @page and photos, and the print skips the raster (a download still rasterises)

This commit is contained in:
Doxa Maps 2026-10-03 15:13:02 +00:00
parent 1a8d9da8d9
commit efd4e6f11a

View file

@ -610,11 +610,12 @@ async function exportPoster(item) {
const format = props.posterAction === 'print' ? 'letter' : (item.sheet === '3x3' ? '3x3' : '3x4')
const html = await Promise.resolve().then(() => props.sheet(item, format, { onStep: step })).catch(() => '')
if (html) {
const { rasterPoster, looksRendered, hasExternalImages } = await import('@map/packet/poster-raster.js')
// ★ A SHEET WITH PHOTOS PRINTS AS ITS OWN DOCUMENT (the large side-lane sheets): a raster cannot carry a
// photo from its own host (poster-raster.js says why), and the sheet's own @page is its true size
// (60in 96in), where an image of it would be shrunk onto letter. A download still rasterises, without them.
if (props.posterAction === 'print' && hasExternalImages(html)) { await printSheetDocument(html); return }
const { rasterPoster, looksRendered } = await import('@map/packet/poster-raster.js')
// ★ A PRINTED SHEET IS ITS OWN DOCUMENT, never an image of itself. The sheet is vector HTML/SVG with its own
// @page; printed as is, the print is the same drawing (crisper), carries any photo from its own host (a raster
// cannot: poster-raster.js says why), and skips the raster entirely: on a phone that decode + draw + encode was
// the last multi-second freeze before the print dialog. A DOWNLOAD still rasterises (it needs an image file).
if (props.posterAction === 'print') { step('print'); await printSheetDocument(html); return }
step('print')
// let the step paint before the raster starts: the SVG decode below holds the page while it draws
await new Promise((r) => (typeof requestAnimationFrame === 'function' ? requestAnimationFrame(() => setTimeout(r, 0)) : setTimeout(r, 0)))