You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Is it possible to export Arabic and Chinese characters in pdf export #234
this is how text in pdf looks
Disclaimer: By reading this you agree that the template is working as per requirement
I’mmm # # #### ## ## Agree/Disagree bla bla bla
@sirishayalavarthi, the PDF converter uses default fonts for conversion and the default fonts do not support all unicode code points. I have not yet resolved this issue or figured out how to get around it. See #181
A solution to the font problem is to define an embedded TrueType font in the style or stylesheet and set the body tag to use this font. OpenHtmlToPDF will use the characters from the font which has them defined.
For example including Noto Serif/Sans/Mono fonts and adding noto-serif, noto-sans and noto-mono families to CSS to allow PDF to use these for rendering text.
However, the PDF converter requires TrueType fonts and Noto CJK fonts are OpenFonts which cannot be used. The solution is to download a TrueType Unicode font that supports CJK character set and add it to the custom rendering profile to be used for PDF.
Activity
vsch commentedon May 22, 2018
@sirishayalavarthi, the PDF converter uses default fonts for conversion and the default fonts do not support all unicode code points. I have not yet resolved this issue or figured out how to get around it. See #181
vsch commentedon Jan 24, 2019
A solution to the font problem is to define an embedded TrueType font in the style or stylesheet and set the
bodytag to use this font. OpenHtmlToPDF will use the characters from the font which has them defined.For example including Noto Serif/Sans/Mono fonts and adding
noto-serif,noto-sansandnoto-monofamilies to CSS to allow PDF to use these for rendering text.However, the PDF converter requires TrueType fonts and
Noto CJKfonts are OpenFonts which cannot be used. The solution is to download a TrueType Unicode font that supports CJK character set and add it to the custom rendering profile to be used for PDF.For my test I used
arialuni.ttffrom https://www.wfonts.com/font/arial-unicode-msIf the installation directory for the fonts is
/usr/local/fonts/then the following in the stylesheet should be added:Sample PdfConverter.java updated. Wiki Page with information added: PDF-Renderer-Converter