diff --git a/frontend/src/components/PDFGenerator.js b/frontend/src/components/PDFGenerator.js index 8417260..a0a659c 100644 --- a/frontend/src/components/PDFGenerator.js +++ b/frontend/src/components/PDFGenerator.js @@ -20,7 +20,20 @@ class PDFGenerator { } async addSchedule(element) { - const canvas = await html2canvas(element, { scale: 2 }); + const canvas = await html2canvas(element, { + scale: 2, + onclone: (clonedDoc) => { + // Klon des Wurzel-Elements + const tbl = clonedDoc.getElementById(element.id); + if (!tbl) return; + + // Alle Zellen und Überschriften-Elemente auswählen + const cells = tbl.querySelectorAll('td, th'); + cells.forEach(cell => { + cell.style.fontSize = '12pt'; + }); + } + }); const imgData = canvas.toDataURL('image/png'); const imgWidth = 210 - this.margin * 2; const imgHeight = (canvas.height * imgWidth) / canvas.width;