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
This commit is contained in:
drelich
2026-03-17 10:27:08 +01:00
parent 19a42a1190
commit 55f50f3a77

View File

@@ -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);