Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-18 02:01:35 +00:00
co-authored by renee-png
parent 0eea828452
commit 75ed5d4c06
+27
View File
@@ -270,6 +270,33 @@ export async function downloadPleadingPdf(input: PleadingInput, filename: string
});
}
// Signature block (above footnotes)
const sig = input.signature;
if (sig && (sig.block?.trim() || sig.imageDataUrl)) {
ensureSpace(LINE_H * 6);
y += LINE_H * 1.5;
if (sig.imageDataUrl) {
try {
const fmt = (sig.imageType || "png").toUpperCase();
// ~3 inches wide, ~1 inch tall
pdf.addImage(sig.imageDataUrl, fmt as any, MARGIN, y - LINE_H, 220, 70);
y += 70 - LINE_H + 4;
} catch {
y += LINE_H * 2;
}
} else {
y += LINE_H * 3; // reserve space for a wet signature
}
setFont(pdf, {});
pdf.text("_______________________________", MARGIN, y);
y += LINE_H;
sig.block.split("\n").forEach((line) => {
ensureSpace(LINE_H);
pdf.text(line, MARGIN, y);
y += LINE_H;
});
}
const fns = (input.footnotes || []).filter((f) => f.text.trim().length > 0);
if (fns.length > 0) {
ensureSpace(LINE_H * 2);