update 20250416

This commit is contained in:
Stefan Hutter
2025-04-16 21:33:23 +02:00
parent a65bc81881
commit d278bed131
368 changed files with 85780 additions and 553 deletions

View File

@@ -287,20 +287,48 @@ namespace Versandstrasse
Dictionary<int, List<RectangleF>> matchedTextbounds = new Dictionary<int, List<RectangleF>>();
document.FindText(texttoreplace, out matchedTextbounds);
for (int i = 0; i < matchedTextbounds.Count; i++)
List<RectangleF> machedrect = new List<RectangleF>();
int pageindex = 0;
for (int i = 0; i < document.Pages.Count; i++)
{
for (int i1 = 0; i1 < document.Pages.Count; i1++)
document.FindText(texttoreplace, pageindex, out machedrect);
loadedPage = (PdfLoadedPage)document.Pages[i];
foreach (RectangleF rectangle in matchedTextbounds[i])
{
loadedPage = (PdfLoadedPage)document.Pages[i1];
foreach (RectangleF rectangle in matchedTextbounds[i])
{
loadedPage.Graphics.DrawRectangle(PdfBrushes.White, rectangle);
loadedPage.Graphics.DrawString(newtext, font, PdfBrushes.Black, rectangle.X - 2, rectangle.Y - 2);
}
RectangleF rect = rectangle;
rect.X = rect.X - 5;
rect.Y = rect.Y - 5;
rect.Height = rect.Height + 5;
loadedPage.Graphics.DrawRectangle(PdfBrushes.White, rectangle);
loadedPage.Graphics.DrawRectangle(PdfBrushes.White, rect);
loadedPage.Graphics.DrawString(newtext, font, PdfBrushes.Black, rectangle.X - 2, rectangle.Y - 3);
}
}
//for (int i = 0; i < matchedTextbounds.Count; i++)
//{
// for (int i1 = 0; i1 < document.Pages.Count; i1++)
// {
// loadedPage = (PdfLoadedPage)document.Pages[i1];
// foreach (RectangleF rectangle in matchedTextbounds[i])
// {
// RectangleF rect = rectangle;
// rect.X = rect.X - 5;
// rect.Y = rect.Y - 5;
// rect.Height = rect.Height + 5;
// loadedPage.Graphics.DrawRectangle(PdfBrushes.White, rectangle);
// loadedPage.Graphics.DrawRectangle(PdfBrushes.White, rect);
// loadedPage.Graphics.DrawString(newtext, font, PdfBrushes.Black, rectangle.X - 2, rectangle.Y - 3);
// }
// }
//}
}
private string get_logo(bool color, string resturi, string apikey)