PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Mar 19, 2024 8:37 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Fri Dec 03, 2021 11:20 am 
Offline

Joined: Fri Dec 03, 2021 11:09 am
Posts: 1
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 43 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group