Render non-English Characters in PDF Forms
When you export your SurveyJS forms to PDF, you may notice that characters from non-English languages, such as Arabic, Chinese, Russian, Greek, Hebrew, or accented Latin letters appear as blank spaces, garbled text, or symbols. This happens because the standard 14 PDF fonts supported in the SurveyJS PDF Generator by default don't include glyphs for certain special characters used in non-Latin languages. To ensure all characters render correctly in your PDF, register a custom font that includes the required characters. This demo shows how to register the Noto Sans Korean font to generate a PDF form with Korean characters.
Call the DocController.addFont(fontName, base64, fontStyle)
method to add a custom font to PDF Generator. This method accepts the following parameters:
fontName
:string
A custom name that you will use to apply the custom font.base64
:string
The custom font as a Base64-encoded string. To encode your font to Base64, obtain it as a TTF file and use any TTF-to-Base64 online converter.fontStyle
:"normal"
|"bold"
|"italic"
|"bolditalic"
The style of the custom font.
To apply a custom font to a PDF document, assign its name to the fontName
property in the IDocOptions
object.