PDFsharp & MigraDoc Foundation

Diacritics letters inside PDF form fields
Page 1 of 1

Author:  xfackovecm1 [ Fri Dec 03, 2021 11:20 am ]
Post subject:  Diacritics letters inside PDF form fields

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:

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.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group