Render Special Characters in PDF
SurveyJS PDF Generator supports standard 14 PDF fonts. However, these fonts do not include glyphs for certain special characters and lack support for languages that use non-Latin character sets. To properly render a PDF form in this case, PDF Generator needs a custom font. This demo shows how to use 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.