From 59bb8cefb95aba7ff54d3aa0651e3730bbed0c2f Mon Sep 17 00:00:00 2001 From: mihretue Date: Tue, 18 Aug 2026 12:59:08 +0000 Subject: [PATCH] fix(exam): stop print margins doubling up, fitting far fewer questions per page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit body had its own 40px padding + max-width:800px for the on-screen preview tab, which stacked with @page's own margin once actual printing kicked in — the preview tab never shows @page at all, so it looked like one continuous page while the real printed output wasted ~150px+ of page height per side and was capped to 800px wide regardless of the physical page width. In @media print specifically: padding:0, max-width:none — @page's margin is the only inset that should apply once printing. Co-Authored-By: Claude Sonnet 5 --- .../src/app/features/exam/pages/ExamDetailPage.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/backoffice/src/app/features/exam/pages/ExamDetailPage.tsx b/apps/backoffice/src/app/features/exam/pages/ExamDetailPage.tsx index 454238995..682104fab 100644 --- a/apps/backoffice/src/app/features/exam/pages/ExamDetailPage.tsx +++ b/apps/backoffice/src/app/features/exam/pages/ExamDetailPage.tsx @@ -294,7 +294,12 @@ export function ExamDetailPage() { never overlaps question text on the last page. */ @media print { @page { margin: 20mm 20mm 28mm 20mm; } - body { -webkit-print-color-adjust: exact; padding-bottom: 0; } + /* @page's margin already insets content from the physical page + edge — body's own 40px padding (needed on-screen, for the + preview tab before printing) would double up with it here, + wasting real page height on every side and fitting noticeably + fewer questions per page than the paper actually has room for. */ + body { -webkit-print-color-adjust: exact; padding: 0; max-width: none; } .footer { position: fixed; bottom: 0; left: 0; right: 0; margin-top: 0; } }