From 6bc88b3c0dd9a8eb631034534531890d9fe687c0 Mon Sep 17 00:00:00 2001 From: Martin Gross Date: Tue, 8 Jul 2025 11:15:11 +0200 Subject: [PATCH] Invoice: Add spacer before optional intro text (#5297) --- src/pretix/base/invoice.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pretix/base/invoice.py b/src/pretix/base/invoice.py index 84c7d32af..3f0a2b251 100644 --- a/src/pretix/base/invoice.py +++ b/src/pretix/base/invoice.py @@ -639,11 +639,16 @@ class ClassicInvoiceRenderer(BaseReportlabInvoiceRenderer): )) if self.invoice.introductory_text: + # While all intro fields are appended without any blank lines; we do want one before the optional intro + # text. However, if there are no prior intro fields, adding an additional spacer will waste space. + if story: + story.append(Spacer(1, 5 * mm)) + story.append(Paragraph( self._clean_text(self.invoice.introductory_text, tags=['br']), self.stylesheet['Normal'] )) - story.append(Spacer(1, 10 * mm)) + story.append(Spacer(1, 5 * mm)) return story