diff --git a/src/components/forms/custom-form-builder.tsx b/src/components/forms/custom-form-builder.tsx index b686dce..7342044 100644 --- a/src/components/forms/custom-form-builder.tsx +++ b/src/components/forms/custom-form-builder.tsx @@ -300,14 +300,16 @@ export function CustomFormBuilder() { setTemplates((data ?? []) as unknown as SavedTemplate[]); }; - // Apply font style + line height to editor DOM + // Apply font style + line height + page margin to editor DOM useEffect(() => { if (!editor) return; const el = editor.view.dom as HTMLElement; el.style.fontFamily = `"${fontFamily}", Georgia, serif`; el.style.fontSize = `${fontSize}pt`; el.style.lineHeight = String(lineHeight); - }, [editor, fontFamily, fontSize, lineHeight]); + const padPx = Math.round(marginInches * 96); + el.style.padding = `${padPx}px`; + }, [editor, fontFamily, fontSize, lineHeight, marginInches]); const insertVar = (key: string) => { if (!editor) return;