From 07e5c856aaf131dc935c4e6c4587f7ad3efaedc1 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 18:26:38 +0000 Subject: [PATCH] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/lib/docx-pleading.ts | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/src/lib/docx-pleading.ts b/src/lib/docx-pleading.ts index 6960acc..fd54980 100644 --- a/src/lib/docx-pleading.ts +++ b/src/lib/docx-pleading.ts @@ -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