Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

PDF Forms and Unicode Characters in JavaScript

Hello, I used the ReportBuilder to create a PDF form with a validation script before submitting data to my client's web server. Unfortunately I found it corrupts Unicode characters like "č", "ě", "š" (c, e and s with hook) etc., so the only way how to build a proper warnings for users is to build those string via String.fromCharCode(0x10D, 0x11B, 0x161), which is very uncomfortable. Please, can you check this issue and solve it for a next release?

Comments

  • edited September 2020
    Hi Igor,

    Unicode characters in PDF form fields are currently only partially supported in ReportBuilder. The primary issue is that Unicode in PDF requires all fonts to be embedded in the PDF file. For form fields (where the entry can be any character) this requires that the entire font is embedded making unreasonably large PDF files. This is something we have on our possible enhancements list to research for a future release.


    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • Hi Nico,

    in my case the problem is in the JavaScript validating the PDF form before submitting. I need to display some alerts to users in Czech language and instead of app.alert("Prosím, vyplňte vaše jméno"); - Please, enter your name - I have to write app.alert("Prosím, vypl" + String.fromCharCode(0x148) + "te va" + String.fromCharCode(0x161) + "e jméno"); because otherwise the letters "ň" and "š" will be changed to some invalid characters during PDF producing. It looks like a problem when converting Unicode to Ansi characters.

    Similar problem was some time ago when I wanted such characters to appear in PDF properties (e.g. title or author), but in the last version you had solved it somehow.

    I partially solved the problem with the embedded font characters via a "hidden" field containing all letters I expect the user can use (approx. 300 characters covering western and eastern Europe alphabets). It would be nice to have a TStrings field where we could specify something like Font Name=all character which need to be embedded (and each line could specify a different font name).

    Best regards,
    Igor
  • Hi Igor,

    Thanks for the clarification and info. I will research this further and post back here once a solution is found.


    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
Sign In or Register to comment.