Documents: Fix letterhead and other problems
All checks were successful
Test / Run tests (push) Successful in 2m39s

This commit is contained in:
2026-03-27 12:06:19 +01:00
parent 982a6616e1
commit 3c52156b7e
6 changed files with 79 additions and 63 deletions

View File

@@ -1,10 +1,21 @@
using Elwig.Models.Entities;
using iText.Kernel.Pdf;
using iText.Kernel.Pdf.Canvas;
using iText.Layout;
namespace Elwig.Documents {
public class Letterhead : BusinessDocument {
public Letterhead(Member m) :
base($"Briefkopf {m.FullName}", m, true) {
Aside = null;
}
protected override void RenderBody(iText.Layout.Document doc, PdfDocument pdf) {
// do not render anything except this
var page = pdf.AddNewPage();
var pageSize = page.GetPageSize();
var pdfCanvas = new PdfCanvas(page.NewContentStreamBefore(), page.GetResources(), pdf);
using var canvas = new Canvas(pdfCanvas, pageSize);
RenderAddress(canvas, pageSize);
}
}
}