From 992f8ba147ee6dc724be570bcfc47ba91a8815b4 Mon Sep 17 00:00:00 2001 From: Riyadh Date: Mon, 4 May 2026 11:15:55 +0000 Subject: [PATCH] Task #377: Improve PDF cell spacing, line-height, and use system fontColor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes in artifacts/api-server/src/lib/pdf-html-renderer.ts: 1. Increased cell padding from 2px 4px to 10px 12px (body cells) and 3px 4px to 8px 12px (header cells) for better readability 2. Increased line-height from 1.05 to 1.8 (body cells) and 1.2 to 1.6 (header cells and body baseline) 3. Page title (h1) now uses system fontColor instead of hardcoded #000 4. Footer text now uses system fontColor for consistency 5. Attendee items get direction-aware margin (12px) for better spacing 6. Logo header uses conditional min-height (55px when logo present, auto when absent) to prevent overlap and empty space 7. Footer date-line margin increased from 2px to 4px Header background (#0B1E3F), header text (white), and border color (#d1d5db) remain as branded defaults — no DB columns exist for these yet (follow-up task #378 proposed for that). No changes to web UI, schema, or legacy pdf-renderer.ts. Tested: AR and EN PDFs generate successfully with correct sizes. E2E test passed: login, PDF download (both languages), and UI verified. --- .../api-server/src/lib/pdf-html-renderer.ts | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/artifacts/api-server/src/lib/pdf-html-renderer.ts b/artifacts/api-server/src/lib/pdf-html-renderer.ts index b297170a..740df80a 100644 --- a/artifacts/api-server/src/lib/pdf-html-renderer.ts +++ b/artifacts/api-server/src/lib/pdf-html-renderer.ts @@ -303,15 +303,16 @@ body { font-weight: ${fontWeight}; color: ${fontColor}; direction: ${dir}; - line-height: 1.05; + line-height: 1.6; -webkit-print-color-adjust: exact; print-color-adjust: exact; } .page-header { text-align: center; - margin-bottom: 8px; + margin-bottom: 10px; position: relative; + min-height: ${logoHtml ? "55px" : "auto"}; } .page-header .logo { @@ -323,9 +324,9 @@ body { .page-header h1 { font-size: ${Math.min(22, fontSize + 6)}px; font-weight: bold; - color: #000; + color: ${fontColor}; margin: 0; - padding: 8px 0; + padding: 10px 0; } table { @@ -345,19 +346,19 @@ thead th { color: white; font-weight: bold; text-align: center; - padding: 3px 4px; + padding: 8px 12px; font-size: ${fontSize}px; - line-height: 1.2; + line-height: 1.6; border: none; } tbody td { - padding: 2px 4px; - vertical-align: middle; + padding: 10px 12px; + vertical-align: top; text-align: center; border: 0.5px solid #d1d5db; font-size: ${fontSize}px; - line-height: 1.05; + line-height: 1.8; word-wrap: break-word; overflow-wrap: break-word; } @@ -398,12 +399,14 @@ tr { white-space: normal; direction: ${dir}; unicode-bidi: isolate; + line-height: 1.8; } .attendee-item { white-space: nowrap; unicode-bidi: isolate; display: inline; + margin-${isRtl ? "left" : "right"}: 12px; } .page-footer { @@ -411,6 +414,7 @@ tr { bottom: 0; ${isRtl ? "right" : "left"}: 0; width: 100%; + color: ${fontColor}; font-size: ${Math.max(11, Math.round(fontSize * 0.95))}px; text-align: ${isRtl ? "right" : "left"}; padding-top: 8px; @@ -421,7 +425,7 @@ tr { } .page-footer .date-line { - margin-top: 2px; + margin-top: 4px; }