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:44:42 +00:00
co-authored by renee-png
parent 09fc48b70b
commit 46070b958d
+12 -8
View File
@@ -109,22 +109,26 @@ export function EstoppelForm() {
);
const handleExport = () => {
if (!client) {
if (!client || !template) {
toast.error("Select a client first");
return;
}
const font = (template.font ?? "helvetica") as "helvetica" | "times" | "courier";
const fontSize = template.fontSizePt ?? 10;
const titleSize = template.titleFontSizePt ?? 16;
const margin = template.marginPt ?? 54;
const doc = new jsPDF({ unit: "pt", format: "letter" });
const pageW = doc.internal.pageSize.getWidth();
const margin = 54;
let y = 60;
// Header
doc.setFont("helvetica", "bold");
doc.setFontSize(16);
doc.text("ESTOPPEL CERTIFICATE", margin, y);
y += 22;
doc.setFont("helvetica", "normal");
doc.setFontSize(10);
doc.setFont(font, "bold");
doc.setFontSize(titleSize);
doc.text(template.title || "ESTOPPEL CERTIFICATE", margin, y);
y += titleSize + 6;
doc.setFont(font, "normal");
doc.setFontSize(fontSize);
doc.text(client.name, margin, y);
y += 12;
if (firm?.company_name) {