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