Hello everybody,
I am working on application where I basically try to fill PDF form fields. Everything is working except some letters with diacritics.
The problematic letters are: "ľ š č ť ž ď ň" , " ýááíéäňúôĺýé" are displayed correctly for example.
I tried every advice which I found on stackoverflow or here but without success. (different fonts, encoding, ...)
My method where I am doing the mapping:
Code:
private void MapField(PdfAcroField.PdfAcroFieldCollection fields, string value, string fieldName)
{
var currentField = (PdfTextField)fields[fieldName];
if (currentField != null)
{
currentField.Value = new PdfString(value);
XPdfFontOptions options = new(PdfFontEncoding.Unicode);
XFont font = new XFont("Times New Roman", 12, XFontStyle.Regular, options);
currentField.Font = font;
}
}
Thanks for any advice in advance.