I have issues with adding German special characters to a pdf.
Attached is the output im getting with the wrong values.
I have verified that the special characters are actually correct before adding them to the pdf..
The code im using for adding the values are
var lst = new PdfGridCellContentList();
lst.List.Add(AddCellLine("Customer", 10, true, false));
lst.List.Add(AddCellLine(customer.Name, 10, false, true));
lst.List.Add(AddCellLine(customer.Address, 10, false, true));
var line = $"{customer.Zip} {customer.City}";
lst.List.Add(AddCellLine(line, 10, false, true));
if (!string.IsNullOrEmpty(customer.Phone))
{
lst.List.Add(AddCellLine($"Phone {customer.Phone}", 10, false, true));
}
row.Cells[0].Value = lst;
}
private static PdfGridCellContent AddCellLine(string text, int fontSize, bool fontBold, bool newLine)
{
var font = RegularFont(fontSize);
if (fontBold) font = BoldFont(fontSize);
if (newLine)
{
text = "\n" + text;
}
var result = new PdfGridCellContent
{
Text = text,
Font = font,
StringFormat = new PdfStringFormat
{
WordWrap = PdfWordWrapType.WordOnly
}
};
return result;
}