Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Thu Jan 18, 2018 9:12 am

Hi, I´m using Spire.PDF (Spire.Office evaluation) and trying to fill pdf form widget text fields with Czech chars (příliš žluťoučký kůň úpěl ďábelské ódy). But when I set form flattening, in result pdf is diacritics broken (pøíliš žlu•ouèký kùò úpìl ïábelské ódy). Document embedded font encoding is WinAnsiEncoding.

Can you help me? We want buy licence of Spire.Office.

sevcikl
 
Posts: 3
Joined: Wed Jan 17, 2018 3:20 pm

Thu Jan 18, 2018 9:43 am

Hello,

Thanks for your inquiry.
I have noticed the issue and referred it to our dev team.
Once there's any update, I will let you know.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Fri Jan 19, 2018 9:18 am

Hi,

Greetings from e-iceblue!
After an initial investigation, we found the issue can be resolved by specifying the font which supports the character you added, eg, the "Arial". The latest pdf hotfix can generate correct result after declaring font, yet it is not included in the recent office package. Once the new office hotfix is released, I will let you know.
Below is the code to set font.

Code: Select all
   PdfDocument doc = new PdfDocument();
    doc.LoadFromFile(file);
    PdfFormWidget formWidget = doc.Form as PdfFormWidget;
    for (int i = 0; i < formWidget.FieldsWidget.List.Count; i++)
    {
        PdfField field = formWidget.FieldsWidget.List[i] as PdfField;
        if (field is PdfTextBoxFieldWidget)
        {
            PdfTextBoxFieldWidget textBoxField = field as PdfTextBoxFieldWidget;
            textBoxField.Font = new PdfTrueTypeFont(new Font("Arial", 8), true);
            switch (textBoxField.Name)
            {
                case "textbox name ":
                    textBoxField.Text = "příliš žluťoučký kůň úpěl ďábelské ódy";
                    break;
            }
        }
    }


Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Mon Jan 22, 2018 11:56 am

Hi, unfortunatelly I tried this solution before first post, but not working for me (after flattening form). My test project with pdf template is attached.
Thanks

sevcikl
 
Posts: 3
Joined: Wed Jan 17, 2018 3:20 pm

Tue Jan 23, 2018 6:49 am

Hello,

Thanks for your reply. The fix haven't been added to Spire.Office at present. You could use the dlls from latest Spire.PDF(Spire.PDF Pack(Hot Fix) Version:3.9.604) and have a try. Once we release the new version of Spire.Office, we will inform you.

Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Tue Jan 23, 2018 12:02 pm

Hotfix works, thanks a lot.

sevcikl
 
Posts: 3
Joined: Wed Jan 17, 2018 3:20 pm

Wed Jan 24, 2018 1:46 am

Hello,

Thanks for your feedback. If any other query, please feel free to contact us.

Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Return to Spire.PDF