From d1469e8868f326d089a10ca7d54b11f49d14feba Mon Sep 17 00:00:00 2001 From: Elias Fierke Date: Mon, 6 Jul 2026 14:25:00 +0200 Subject: [PATCH] [chore:] pvst image preparation --- Tasks/PdfBuilder.cs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Tasks/PdfBuilder.cs b/Tasks/PdfBuilder.cs index 10e2448..b526347 100644 --- a/Tasks/PdfBuilder.cs +++ b/Tasks/PdfBuilder.cs @@ -181,8 +181,8 @@ public class PdfBuilder string output_inter = outputPath.Replace(".pdf", "-international.pdf"); - if(addresses_german.Count > 0) CreateAddressLabelPdfWithPlaceholder(addresses_german, placeholderText, outputPath); - if(addresses_inter.Count > 0) CreateAddressLabelPdfWithPlaceholder(addresses_inter, placeholderText, output_inter); + if(addresses_german.Count > 0) CreateAddressLabelPdfWithPlaceholder(addresses_german, placeholderText, outputPath, pvst); + if(addresses_inter.Count > 0) CreateAddressLabelPdfWithPlaceholder(addresses_inter, placeholderText, output_inter, pvst); if (_settings.exportRunningSheets) { @@ -207,7 +207,7 @@ public class PdfBuilder /// Array of addresses /// Text for the first cell (top-left) /// Path where the PDF should be saved - public void CreateAddressLabelPdfWithPlaceholder(List addresses, string placeholderText, string outputPath) + public void CreateAddressLabelPdfWithPlaceholder(List addresses, string placeholderText, string outputPath, bool pvst) { try { @@ -226,7 +226,7 @@ public class PdfBuilder using (var gfx = XGraphics.FromPdfPage(page)) { - DrawPageWithPlaceholder(gfx, addresses, ref addressIndex, ref isFirstCell, placeholderText); + DrawPageWithPlaceholder(gfx, addresses, ref addressIndex, ref isFirstCell, placeholderText, pvst); } } @@ -241,7 +241,7 @@ public class PdfBuilder private void DrawPageWithPlaceholder(XGraphics gfx, List addresses, ref int addressIndex, - ref bool isFirstCell, string placeholderText) + ref bool isFirstCell, string placeholderText, bool pvst) { try { @@ -254,12 +254,12 @@ public class PdfBuilder // First cell: placeholder if (isFirstCell) { - DrawCell(gfx, x, y, placeholderText); + DrawCell(gfx, x, y, pvst, placeholderText); isFirstCell = false; } else if (addressIndex < addresses.Count) { - DrawCell(gfx, x, y, addresses[addressIndex]); + DrawCell(gfx, x, y, pvst, addresses[addressIndex]); addressIndex++; } else @@ -275,7 +275,7 @@ public class PdfBuilder } - private void DrawCell(XGraphics gfx, double x, double y, string? address) + private void DrawCell(XGraphics gfx, double x, double y, bool pvst, string? address) { try { @@ -286,6 +286,11 @@ public class PdfBuilder var rect = new XRect(x, y, cellWidthPoints, cellHeightPoints); gfx.DrawRectangle(XPens.Transparent, rect); + if (pvst) + { + // Draw image here + } + // Draw address content if available if (!string.IsNullOrEmpty(address)) DrawMarkdownText(gfx, address, x, y, cellWidthPoints, cellHeightPoints); }