diff --git a/backend/src/services/creditNotePdf.service.ts b/backend/src/services/creditNotePdf.service.ts index 85ed96b1..a975da20 100644 --- a/backend/src/services/creditNotePdf.service.ts +++ b/backend/src/services/creditNotePdf.service.ts @@ -165,8 +165,13 @@ export async function generateCreditNotePdf(creditNoteId: number): Promise<{ buf const footerWidth = 495; doc.fontSize(7).fillColor('#888'); const footerHeight = doc.heightOfString(footerText, { width: footerWidth, align: 'center' }); + // Unteren Rand für die Fußzeile kurz verkleinern, damit sie ein Stück + // tiefer sitzt, ohne dass pdfkit eine zweite Seite anlegt. + const savedBottom = doc.page.margins.bottom; + doc.page.margins.bottom = 22; const bottomLimit = doc.page.height - doc.page.margins.bottom; doc.text(footerText, 50, bottomLimit - footerHeight - 2, { width: footerWidth, align: 'center' }); + doc.page.margins.bottom = savedBottom; doc.fillColor('#000'); doc.end();