diff --git a/src/lib/bookman-fonts.ts b/src/lib/bookman-fonts.ts index b91bc43..9f35587 100644 --- a/src/lib/bookman-fonts.ts +++ b/src/lib/bookman-fonts.ts @@ -6810,16 +6810,14 @@ const bolditalic_b64 = "LUEtQRu6BAAEAAALK1mwDiNCsA8jQrASQ1i5GH47IRu6AagEAAALK1mwECNCsBEjQgEBKysrKysrKysrKysrKytzc3N0dHRzc3Nz" + "c3Nzc3Nzc3Nzc15zXnN0dQErK3NzdHVzdHUAKysrKysrAEuwHlBYsANFaLgDakVosECLYLAgI0RZsAdFaLgDa0VosECLYLAiI0QA"; -let registered = false; export function registerBookmanFont(pdf: jsPDF) { - // Add to VFS once; jsPDF instances share the global file system. - if (!registered) { - pdf.addFileToVFS("BookmanOldStyle-Regular.ttf", regular_b64); - pdf.addFileToVFS("BookmanOldStyle-Italic.ttf", italic_b64); - pdf.addFileToVFS("BookmanOldStyle-Bold.ttf", bold_b64); - pdf.addFileToVFS("BookmanOldStyle-BoldItalic.ttf", bolditalic_b64); - registered = true; - } + // jsPDF's VFS is per-instance — must add files for every new pdf object + // before calling addFont, otherwise addFont throws + // "Font is not stored as string-data in vFS". + pdf.addFileToVFS("BookmanOldStyle-Regular.ttf", regular_b64); + pdf.addFileToVFS("BookmanOldStyle-Italic.ttf", italic_b64); + pdf.addFileToVFS("BookmanOldStyle-Bold.ttf", bold_b64); + pdf.addFileToVFS("BookmanOldStyle-BoldItalic.ttf", bolditalic_b64); pdf.addFont("BookmanOldStyle-Regular.ttf", BOOKMAN_FAMILY, "normal"); pdf.addFont("BookmanOldStyle-Italic.ttf", BOOKMAN_FAMILY, "italic"); pdf.addFont("BookmanOldStyle-Bold.ttf", BOOKMAN_FAMILY, "bold"); diff --git a/src/lib/docx-pleading.ts b/src/lib/docx-pleading.ts index fd54980..30f4c6b 100644 --- a/src/lib/docx-pleading.ts +++ b/src/lib/docx-pleading.ts @@ -65,9 +65,9 @@ const noBorder = { insideVertical: { style: BorderStyle.NONE, size: 0, color: "FFFFFF" }, }; -const verticalLine = { +const captionLeftBorders = { top: { style: BorderStyle.NONE, size: 0, color: "FFFFFF" }, - bottom: { style: BorderStyle.NONE, size: 0, color: "FFFFFF" }, + bottom: { style: BorderStyle.SINGLE, size: 8, color: "000000" }, left: { style: BorderStyle.NONE, size: 0, color: "FFFFFF" }, right: { style: BorderStyle.SINGLE, size: 8, color: "000000" }, }; @@ -252,19 +252,19 @@ export function buildPleadingDoc(input: PleadingInput): Document { const plaintiffLines = (input.plaintiffs || "").split("\n").filter((l) => l.trim().length > 0); const defendantLines = (input.defendants || "").split("\n").filter((l) => l.trim().length > 0); - // Left side of caption + // Left side of caption — all bold const leftCells: Paragraph[] = []; - plaintiffLines.forEach((l) => leftCells.push(p(l))); - if (plaintiffLines.length === 0) leftCells.push(p("")); + plaintiffLines.forEach((l) => leftCells.push(p(l, { bold: true }))); + if (plaintiffLines.length === 0) leftCells.push(p("", { bold: true })); leftCells.push(emptyP()); - leftCells.push(p("Plaintiff(s),")); + leftCells.push(p("Plaintiff(s),", { bold: true })); leftCells.push(emptyP()); - leftCells.push(p("v.")); + leftCells.push(p("v.", { bold: true })); leftCells.push(emptyP()); - defendantLines.forEach((l) => leftCells.push(p(l))); - if (defendantLines.length === 0) leftCells.push(p("")); + defendantLines.forEach((l) => leftCells.push(p(l, { bold: true }))); + if (defendantLines.length === 0) leftCells.push(p("", { bold: true })); leftCells.push(emptyP()); - leftCells.push(p("Defendant(s).")); + leftCells.push(p("Defendant(s).", { bold: true })); const rightCells: Paragraph[] = [ p(`CASE NO.: ${input.caseNumber || ""}`, { bold: true }), @@ -279,7 +279,7 @@ export function buildPleadingDoc(input: PleadingInput): Document { children: [ new TableCell({ width: { size: 5400, type: WidthType.DXA }, - borders: verticalLine, + borders: captionLeftBorders, margins: { top: 80, bottom: 80, left: 0, right: 200 }, children: leftCells, }), diff --git a/src/lib/pdf-pleading.ts b/src/lib/pdf-pleading.ts index 13f42be..6243f1e 100644 --- a/src/lib/pdf-pleading.ts +++ b/src/lib/pdf-pleading.ts @@ -202,7 +202,7 @@ export async function downloadPleadingPdf(input: PleadingInput, filename: string const plaintiffLines = (input.plaintiffs || "").split("\n").filter((l) => l.trim()); const defendantLines = (input.defendants || "").split("\n").filter((l) => l.trim()); - setFont(pdf, {}); + setFont(pdf, { bold: true }); const captionLeft: string[] = []; if (plaintiffLines.length) captionLeft.push(...plaintiffLines); else captionLeft.push(" "); captionLeft.push(""); @@ -223,7 +223,10 @@ export async function downloadPleadingPdf(input: PleadingInput, filename: string const captionEndY = ly; pdf.setLineWidth(0.6); + // Vertical divider between caption columns pdf.line(MARGIN + leftColW + 12, captionStartY - LINE_H + 4, MARGIN + leftColW + 12, captionEndY); + // Bottom border under the left caption cell + pdf.line(leftX, captionEndY + 2, MARGIN + leftColW + 12, captionEndY + 2); void rightColW; y = captionEndY + LINE_H; diff --git a/src/routes/documents.pleading.new.tsx b/src/routes/documents.pleading.new.tsx index de25605..87f933b 100644 --- a/src/routes/documents.pleading.new.tsx +++ b/src/routes/documents.pleading.new.tsx @@ -298,7 +298,7 @@ function PleadingNewPage() {
-
+
{plaintiffs || " "}
Plaintiff(s),
v.