update3 20260610

This commit is contained in:
Stefan Hutter
2026-06-10 18:14:56 +02:00
parent 42376fc823
commit 58cd45116c
122 changed files with 5760 additions and 293 deletions
+25
View File
@@ -705,7 +705,31 @@ namespace Versandstrasse
if (tr.Fontsize != "") { fsize = tr.Fontsize; }
// PdfUsedFont usedfont = get_fontname(ref document, fname);
PdfFont font = new PdfTrueTypeFont(new Font(fname, Convert.ToInt32(fsize)));
font = null;
if (tr.FontStyle == "")
{
font = new PdfTrueTypeFont(new Font(fname, Convert.ToInt32(fsize)));
}
else
{
int fstylecounter = 0;
var fstyle = FontStyle.Regular;
if (tr.FontStyle.ToUpper().Contains("BOLD")) { if (fstylecounter == 0) { fstyle = FontStyle.Bold;fstylecounter = 1; } else { fstyle = fstyle | FontStyle.Bold; } }
if (tr.FontStyle.ToUpper().Contains("ITALIC")) { if (fstylecounter == 0) { fstyle = FontStyle.Italic; fstylecounter = 1; } else { fstyle = fstyle | FontStyle.Italic; } }
if (tr.FontStyle.ToUpper().Contains("UNDERLINE")) { if (fstylecounter == 0) { fstyle = FontStyle.Underline; fstylecounter = 1; } else { fstyle = fstyle | FontStyle.Underline; } }
if (tr.FontStyle.ToUpper().Contains("STRIKEOUT")) { if (fstylecounter == 0) { fstyle = FontStyle.Strikeout; fstylecounter = 1; } else { fstyle = fstyle | FontStyle.Strikeout; } }
font = new PdfTrueTypeFont(new Font(fname, Convert.ToInt32(fsize), fstyle));
}
//var fstyle = FontStyle.Bold;
//fstyle = fstyle | FontStyle.Underline;
//font = new PdfTrueTypeFont(new Font(fname, Convert.ToInt32(fsize), fstyle));
//PdfFont font = new PdfTrueTypeFont(new Font(fname, Convert.ToInt32(fsize)));
Dictionary<int, List<RectangleF>> matchedTextbounds = new Dictionary<int, List<RectangleF>>();
document.FindText(texttoreplace, out matchedTextbounds);
@@ -1059,5 +1083,6 @@ namespace Versandstrasse
public string Boxpos_Y { get; set; } = "";
public string Boxpos_W { get; set; } = "";
public string Boxpos_H { get; set; } = "";
public string FontStyle { get; set; } = "";
}
}
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.
Binary file not shown.