fix
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user