Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
03118bee0c
commit
bcb9fc363e
+15
-3
@@ -258,10 +258,22 @@ export async function downloadPleadingPdf(input: PleadingInput, filename: string
|
||||
y = captionEndY + LINE_H;
|
||||
|
||||
if (input.title) {
|
||||
ensureSpace(LINE_H * 2);
|
||||
setFont(pdf, { bold: true });
|
||||
pdf.text(input.title.toUpperCase(), PAGE_W / 2, y, { align: "center" });
|
||||
y += LINE_H * 1.5;
|
||||
const titleText = input.title.toUpperCase();
|
||||
const titleLines = pdf.splitTextToSize(titleText, CONTENT_W) as string[];
|
||||
ensureSpace(LINE_H * (titleLines.length + 2));
|
||||
y += LINE_H; // one blank line before title
|
||||
titleLines.forEach((line, i) => {
|
||||
const isLast = i === titleLines.length - 1;
|
||||
pdf.text(line, PAGE_W / 2, y, { align: "center" });
|
||||
if (isLast) {
|
||||
const tw = pdf.getTextWidth(line);
|
||||
pdf.setLineWidth(0.6);
|
||||
pdf.line((PAGE_W - tw) / 2, y + 1.5, (PAGE_W + tw) / 2, y + 1.5);
|
||||
}
|
||||
y += LINE_H;
|
||||
});
|
||||
y += LINE_H; // one blank line after title
|
||||
}
|
||||
|
||||
setFont(pdf, {}); // reset to non-bold for body
|
||||
|
||||
Reference in New Issue
Block a user