New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chinese language #533
Comments
The problem is the font Roboto. Roboto does not accept chinese characters. |
To replace the font |
After replacing fonts, use NPM to compile pdfmake source project execution |
你要下载node.js,然后下载bower,然后下载这个pdfmake的zip并解压,再安装grunt,在pdfmake这个目录下执行grunt dump_dir命令,但是你会发现缺少各种grunt插件,然后你要一个一个安装grunt插件。最后把你想要的支持中文的ttf文件放到pdfmake的examples\fonts目录下,然后执行grunt dump_dir命令,它不报错的情况下会把ttf文件加到build/vfs_fonts.js文件中,然后再引入它就好了。 |
@doyouknowme 你好,我现在在用 https://github.com/devongovett/pdfkit 在server端生成pdf,pdfkit有个问题就是一个字体中字符超过94个就没法显示,请问换用pdfmake能解决这个问题吗? |
@PinkyJie 一个字体中字符超过94个 我没看懂是什么意思。 是一个句子里的字数超过94个字这个意思么? |
@PinkyJie 一个句子的字数超过了一行之后不会换行,只用中文才这样,英文不会这样。pdfmake是基于pdfKit的 所以你用pdfKit会出现的问题 估计pdfmake也会出现 |
@PinkyJie 你也可以用'\n'自己换行,写一个函数把字符串切断再塞入‘\n’就能够实现换行了 |
@doyouknowme 这个foliojs/pdfkit#114 里面提到,字符集太多的话处理不了 |
@doyouknowme 用自定义字体出现Uncaught Error: No unicode cmap for font错误是什么原因? |
@doyouknowme 在服务器端 把新的字体文件上传 对应出来的字符还是没有中文,但是把字符复制到txt 或者word中 里面的中文正常显示,这可能是什么原因呢? |
@amanda94 你的字体文件有经过处理吗?假如没有 看看这个https://github.com/bpampuch/pdfmake/wiki/Custom-Fonts---client-side 自定义的字体需要对项目进行重新grunt |
@doyouknowme 服务器端没有这个文件啊vfs_fonts.js |
@amanda94 加我扣扣吧 1092738937 |
@doyouknowme 编译后显示没有error,我下载的是simsun.ttf,按如下引用后,中文还是不能显示。。求帮助。。 |
@doyouknowme 换成msyh.ttf(微软雅黑)后终于可以了,不过字体包好大呀。。 |
@shenlan211314 |
我在用 1. 中文字体
2. vfs_fonts.js 文件
3. 表格
4. 一个最致命的问题:导出慢
|
Could you guys post instructions in English, too? |
For those looking to add support to languages such as Japanese and Chinese, so that the characters appear properly in the pdf, I did the following in a server-side Node app: When you create a new "PdfPrinter", you have to pass an object with the
In my case, I have some Aozora fonts, so I defined a property for that. I also have the font files at the locations defined by the values. You can choose any fonts for Then, in your docDefinition, define a defaultStyle property to use your font:
where
|
这是来自QQ邮箱的假期自动回复邮件。你好,我最近正在休假中,无法亲自回复你的邮件。我将在假期结束后,尽快给你回复。
|
请问第2个问题: |
Hi!
is it possible to print in chinese(or japanese or etc) anyway? I have teste and no way.
Why? Fonts? UTF?
Here my code:
Thanks for your help
The text was updated successfully, but these errors were encountered: