fix(pdf): drop product title down 10pt on page 2 to eliminate clipping and center grid values
This commit is contained in:
@@ -1164,7 +1164,7 @@ function drawKeyValueTable(args: {
|
||||
const labelSize = 7.25;
|
||||
const valueSize = 8.75;
|
||||
const labelYOff = 12;
|
||||
const valueYOff = 28;
|
||||
const valueYOff = 26;
|
||||
|
||||
const rows = Math.ceil(items.length / cols);
|
||||
const boxH = headerPadY + titleH + rows * cellH + headerPadY;
|
||||
@@ -3386,8 +3386,9 @@ function drawHeader(ctx: SectionDrawContext, yStart: number): number {
|
||||
color: colors.lightGray,
|
||||
});
|
||||
|
||||
// Content start: keep breathing room below the header, but use page height efficiently.
|
||||
return dividerY - 22;
|
||||
// Content start: keep breathing room below the header
|
||||
// (Increased gap to prevent text on page 2 from looking 'stuck' to the header)
|
||||
return dividerY - 32;
|
||||
}
|
||||
|
||||
function drawCrossSectionChipsRow(args: {
|
||||
@@ -4073,17 +4074,17 @@ async function generatePDF(product: ProductData, locale: 'en' | 'de'): Promise<B
|
||||
const name = stripHtml(product.name);
|
||||
const maxW = ctx.contentWidth;
|
||||
const line = wrapText(name, fontBold, 12, maxW).slice(0, 1)[0] || name;
|
||||
// Render name a bit lower inside the header space
|
||||
const headerTopPadding = 24;
|
||||
|
||||
p.drawText(line, {
|
||||
x: margin,
|
||||
y: height - headerTopPadding - 32,
|
||||
y: yStart,
|
||||
size: 12,
|
||||
font: fontBold,
|
||||
color: navy,
|
||||
maxWidth: maxW,
|
||||
});
|
||||
return yStart - 18;
|
||||
// Pushing the table content even further down below the title
|
||||
return yStart - 28;
|
||||
};
|
||||
|
||||
// Real multi-page support.
|
||||
|
||||
Reference in New Issue
Block a user