From 55f50f3a777a6a7a77aa5c440f60f4f3f164380e Mon Sep 17 00:00:00 2001 From: drelich Date: Tue, 17 Mar 2026 10:27:08 +0100 Subject: [PATCH] Adjust PDF margins and content width for balanced layout - Reordered jsPDF html() options for clarity - Added autoPaging: 'text' for better page break handling - Adjusted windowWidth to 650px for better content scaling - Maintains 20mm margins on all sides - Content width set to 170mm (210mm A4 - 40mm margins) - Should produce more balanced left/right margins --- src/components/NoteEditor.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/NoteEditor.tsx b/src/components/NoteEditor.tsx index d705f39..99adc66 100644 --- a/src/components/NoteEditor.tsx +++ b/src/components/NoteEditor.tsx @@ -204,11 +204,10 @@ export function NoteEditor({ note, onUpdateNote, fontSize, onUnsavedChanges }: N setIsExportingPDF(false); }, 500); }, - x: 20, // 20mm left margin - y: 20, // 20mm top margin - width: 170, // 170mm content width (210 - 40) - windowWidth: 800, // Rendering width in pixels margin: [20, 20, 20, 20], // top, right, bottom, left margins in mm + autoPaging: 'text', // Enable automatic page breaks + width: 170, // Content width in mm (A4 width 210mm - 40mm margins) + windowWidth: 650, // Rendering width in pixels (matches content width ratio) }); } catch (error) { console.error('PDF export failed:', error);