Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-18 18:26:38 +00:00
co-authored by renee-png
parent 5f0bde3297
commit 07e5c856aa
+25 -7
View File
@@ -306,9 +306,12 @@ export function buildPleadingDoc(input: PleadingInput): Document {
input.body.split("\n").forEach((line) => bodyParagraphs.push(p(line)));
}
// Signature block (above footnotes, after body)
// Signature block (above footnotes, after body) — right-side, indented ~2/3 of page width
const sig = input.signature;
if (sig && (sig.block?.trim() || sig.imageBytes)) {
const SIG_INDENT = 6240; // ~4.33" from left margin (page content is 9360 dxa wide)
const sigParagraph = (children: TextRun[]) =>
new Paragraph({ indent: { left: SIG_INDENT }, children });
if (sig && (sig.block?.trim() || sig.imageBytes || sig.typed?.trim())) {
bodyParagraphs.push(emptyP());
bodyParagraphs.push(emptyP());
if (sig.imageBytes) {
@@ -318,24 +321,39 @@ export function buildPleadingDoc(input: PleadingInput): Document {
: new Uint8Array(sig.imageBytes);
bodyParagraphs.push(
new Paragraph({
indent: { left: SIG_INDENT },
children: [
new ImageRun({
type: (sig.imageType as any) || "png",
data,
transformation: { width: 220, height: 70 },
transformation: { width: 200, height: 60 },
altText: { title: "Signature", description: "Attorney signature", name: "signature" },
}),
],
}),
);
} else if (sig.typed?.trim()) {
// Typed cursive signature — script font, larger size
bodyParagraphs.push(
new Paragraph({
indent: { left: SIG_INDENT },
children: [
new TextRun({
text: sig.typed.trim(),
font: "Lucida Handwriting",
size: 36,
}),
],
}),
);
} else {
// Reserve vertical space for a wet signature
bodyParagraphs.push(emptyP());
bodyParagraphs.push(emptyP());
}
// Signature line (underscore rule, ~3 inches)
bodyParagraphs.push(p("_______________________________"));
sig.block.split("\n").forEach((line) => bodyParagraphs.push(p(line)));
bodyParagraphs.push(sigParagraph([run("_______________________________")]));
sig.block.split("\n").forEach((line) =>
bodyParagraphs.push(sigParagraph([run(line)])),
);
}
// Footnotes rendered as endnote-style block at bottom of document