Update PDF generation to match reference design and improve alignment

Revert PDF cell padding and text alignment to match the reference design, ensuring centered content and vertical alignment.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 575935a0-0b89-4638-9c64-d47fb0cd4c78
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/Zh9QhRk
Replit-Helium-Checkpoint-Created: true
This commit is contained in:
riyadhafraa
2026-05-04 10:06:22 +00:00
parent 328d867975
commit c4800a474c
3 changed files with 12 additions and 4 deletions
+6
View File
@@ -71,3 +71,9 @@ id = "cY9FCy1T7wF7kkgS0rtGM"
uri = "file://attached_assets/tx-icon/favicon.svg" uri = "file://attached_assets/tx-icon/favicon.svg"
type = "image" type = "image"
title = "Favicon-optimized (32×32, thicker strokes)" title = "Favicon-optimized (32×32, thicker strokes)"
[[outputs]]
id = "iFT-ndtlSuqfB8aUjsUNG"
uri = "file://artifacts/api-server/executive-meetings-final.pdf"
type = "pdf"
title = "PDF النهائي - قائمة حضور الاجتماعات 4 مايو 2026"
Binary file not shown.
+6 -4
View File
@@ -815,7 +815,7 @@ export async function renderSchedulePdf(input: RenderPdfInput): Promise<Buffer>
const headerWidths = isRtl ? [...colWidths].reverse() : colWidths; const headerWidths = isRtl ? [...colWidths].reverse() : colWidths;
const cellPadX = 4; const cellPadX = 4;
const cellPadY = 2; const cellPadY = 0;
const lineHeight = input.font.fontSize * 1.05; const lineHeight = input.font.fontSize * 1.05;
function drawHeader(): number { function drawHeader(): number {
@@ -862,7 +862,7 @@ export async function renderSchedulePdf(input: RenderPdfInput): Promise<Buffer>
{ {
text: htmlToPlain(isRtl ? meeting.titleAr : meeting.titleEn || meeting.titleAr) + text: htmlToPlain(isRtl ? meeting.titleAr : meeting.titleEn || meeting.titleAr) +
(meeting.location ? `\n${meeting.location}` : ""), (meeting.location ? `\n${meeting.location}` : ""),
align: isRtl ? "right" : "left", align: "center",
}, },
{ {
text: text:
@@ -896,7 +896,7 @@ export async function renderSchedulePdf(input: RenderPdfInput): Promise<Buffer>
flushGroup(); flushGroup();
return parts.join("\n"); return parts.join("\n");
})(), })(),
align: isRtl ? "right" : "left", align: "center",
}, },
{ {
text: formatTimeRange(meeting.startTime, meeting.endTime, input.lang), text: formatTimeRange(meeting.startTime, meeting.endTime, input.lang),
@@ -992,7 +992,9 @@ export async function renderSchedulePdf(input: RenderPdfInput): Promise<Buffer>
const c = cells[i]; const c = cells[i];
const cellW = widths[i] - cellPadX * 2; const cellW = widths[i] - cellPadX * 2;
const textLines = c.text.split("\n"); const textLines = c.text.split("\n");
let y = rowTop + cellPadY; const contentH = cellHeights[i] - cellPadY * 2;
const vOffset = Math.max(0, (rowHeight - cellPadY * 2 - contentH) / 2);
let y = rowTop + cellPadY + vOffset;
for (const tl of textLines) { for (const tl of textLines) {
if (y >= rowBottom) break; if (y >= rowBottom) break;
if (!tl) { y += lineHeight; continue; } if (!tl) { y += lineHeight; continue; }