Pdfmake: PDF generated with NotoSansCJKsc-Regular.otf does not render in Chrome or Adobe.

Created on 1 Nov 2017  路  6Comments  路  Source: bpampuch/pdfmake

I am attempting to create a PDF, using pdfmake, with Chinese characters. Specifically, I am using the NotoSansCJKsc-Regular.otf font. Setup: Chrome Version 62.0.3202.75, Windows 10.

The font renders correctly when the generated PDF is viewed in Microsoft Edge.

The font does not render correctly in Chrome - I just get blank characters displayed instead of Chinese. However, the characters do exist there; if I copy and paste the "blank" characters into another window, I see the correct characters.

The font behaves a little bit better in Adobe, however lots of characters are missing, and the rendering of lots of Latin characters is destroyed.

Is there a solution that will allow me to view the font correctly in Chrome or Adobe? I don't necessarily need to use the same font.

3rd-party

Most helpful comment

dorothythurston - Not sure.

We have resolved the issue by using the font KaigenSansSC-*.ttf (https://github.com/m13253/kaigen-fonts)

This is a TTF font that is converted from SourceHanSansSC-*.otf using the bash script found at https://github.com/caryll/otfcc-cubic2quad

By inspecting the pdfmake library, we expected that an OTF font would be converted to a TTF, and this would work, but for some reason the characters were still not rendering correctly. Supplying the library directly with a TTF font seems to do the trick. Perhaps this is a problem with the library; perhaps it is a problem with our understanding of it; perhaps it is a problem with the font we provided.

All 6 comments

Is this a pdfmake problem or is it a problem with the font itself?

dorothythurston - Not sure.

We have resolved the issue by using the font KaigenSansSC-*.ttf (https://github.com/m13253/kaigen-fonts)

This is a TTF font that is converted from SourceHanSansSC-*.otf using the bash script found at https://github.com/caryll/otfcc-cubic2quad

By inspecting the pdfmake library, we expected that an OTF font would be converted to a TTF, and this would work, but for some reason the characters were still not rendering correctly. Supplying the library directly with a TTF font seems to do the trick. Perhaps this is a problem with the library; perhaps it is a problem with our understanding of it; perhaps it is a problem with the font we provided.

Pdfmake using pdfkit library for rendering PDF files, please create issue there. Thanks.

I want to know if I need to buy the copyright of KaigenSansSC-*.ttf ???

any update?

Should be fixed in latest release. If not, send a sample example to reproduce

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dgrice picture dgrice  路  3Comments

svenyonson picture svenyonson  路  3Comments

kumarandena picture kumarandena  路  3Comments

SummerSonnet picture SummerSonnet  路  3Comments

CharlyPoppins picture CharlyPoppins  路  3Comments