Gutschrift-PDF: Fusszeile etwas tiefer positioniert
Unteren Rand fuer die Fusszeile temporaer auf 22 verkleinert, damit sie naeher am Seitenende sitzt - weiterhin nur 1 Seite (verifiziert). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -165,8 +165,13 @@ export async function generateCreditNotePdf(creditNoteId: number): Promise<{ buf
|
|||||||
const footerWidth = 495;
|
const footerWidth = 495;
|
||||||
doc.fontSize(7).fillColor('#888');
|
doc.fontSize(7).fillColor('#888');
|
||||||
const footerHeight = doc.heightOfString(footerText, { width: footerWidth, align: 'center' });
|
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;
|
const bottomLimit = doc.page.height - doc.page.margins.bottom;
|
||||||
doc.text(footerText, 50, bottomLimit - footerHeight - 2, { width: footerWidth, align: 'center' });
|
doc.text(footerText, 50, bottomLimit - footerHeight - 2, { width: footerWidth, align: 'center' });
|
||||||
|
doc.page.margins.bottom = savedBottom;
|
||||||
doc.fillColor('#000');
|
doc.fillColor('#000');
|
||||||
|
|
||||||
doc.end();
|
doc.end();
|
||||||
|
|||||||
Reference in New Issue
Block a user