update 20250416
This commit is contained in:
@@ -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)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user