Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-18 16:47:28 +00:00
co-authored by renee-png
parent 06b9eaae74
commit 1bf5169e91
+3 -1
View File
@@ -1,5 +1,6 @@
import jsPDF from "jspdf";
import type { PleadingInput } from "./docx-pleading";
import { BOOKMAN_FAMILY, registerBookmanFont } from "./bookman-fonts";
// Letter @ 72dpi: 612 x 792. 1" margins = 72.
const PAGE_W = 612;
@@ -24,7 +25,7 @@ function setFont(pdf: jsPDF, style: Style, size = FONT_SIZE) {
if (style.bold && style.italic) weight = "bolditalic";
else if (style.bold) weight = "bold";
else if (style.italic) weight = "italic";
pdf.setFont("times", weight);
pdf.setFont(BOOKMAN_FAMILY, weight);
pdf.setFontSize(size);
}
@@ -173,6 +174,7 @@ function drawFooter(pdf: jsPDF, page: number, totalPages: number, left?: string,
export async function downloadPleadingPdf(input: PleadingInput, filename: string) {
const pdf = new jsPDF({ unit: "pt", format: "letter" });
registerBookmanFont(pdf);
let y = MARGIN;
const bottomLimit = PAGE_H - MARGIN;