From c560d4a6ddf7d673e97f018bcbcd0508d7dc652b Mon Sep 17 00:00:00 2001 From: ordinarthur <@arthurbarre.js@gmail.com> Date: Wed, 13 May 2026 06:11:53 +0200 Subject: [PATCH] Use viewport units in print so pages adapt to actual paper size 100vh/100vw makes each .page span the full physical page regardless of whether the user prints to A4 or US Letter, eliminating the white band on A4 while keeping the footer visible on Letter. Co-Authored-By: Claude Opus 4.7 --- Resume-Arthur-barre-fr.html | 9 +++++---- cv-short.html | 7 ++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Resume-Arthur-barre-fr.html b/Resume-Arthur-barre-fr.html index 3730408..957bf38 100644 --- a/Resume-Arthur-barre-fr.html +++ b/Resume-Arthur-barre-fr.html @@ -452,9 +452,11 @@ @page { size: A4; margin: 0; } @media print { body { background: var(--bg); -webkit-print-color-adjust: exact; print-color-adjust: exact; } + html, body { width: 100%; height: 100%; } .page { - width: 210mm; - height: 297mm; + width: 100vw; + height: 100vh; + padding: 0; page-break-after: always; break-after: page; page-break-inside: avoid; @@ -463,8 +465,7 @@ overflow: hidden; } .page:last-child { page-break-after: auto; break-after: auto; } - .page { padding: 0; } - .frame { height: 297mm; border: none; } + .frame { width: 100%; height: 100%; border: none; } .row, article, .section-header, .topbar, .hero { page-break-inside: avoid; break-inside: avoid; } /* Global print compaction — all pages */ diff --git a/cv-short.html b/cv-short.html index d1ffb08..c156dd7 100644 --- a/cv-short.html +++ b/cv-short.html @@ -352,16 +352,17 @@ @page { size: A4; margin: 0; } @media print { body { background: var(--bg); -webkit-print-color-adjust: exact; print-color-adjust: exact; } + html, body { width: 100%; height: 100%; } .page { - width: 100%; - height: 270mm; /* fits both A4 (297mm) and US Letter (279mm) */ + width: 100vw; + height: 100vh; /* adapts to actual paper size (A4 or US Letter) */ padding: 0; page-break-after: auto; break-after: auto; margin: 0; overflow: hidden; } - .frame { height: 270mm; border: none; overflow: hidden; } + .frame { width: 100%; height: 100%; border: none; overflow: hidden; } /* Tighten content so it fits on US Letter too */ .hero h1 { font-size: 32pt; }