-
Notifications
You must be signed in to change notification settings - Fork 127
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
export to pdf error (when Chinese in content ) #533
Comments
@sholong, it is a limitation of the openhtmltopdf library which is used by the plugin. The library needs additional fonts that have the necessary characters and html changes that will change the text to use those fonts. This is covered by the issue for the library: danfickle/openhtmltopdf#129 I am looking into how this can be handled by the plugin. |
@sholong, fixed in next EAP for non-latin fonts by including Noto Serif/Sans/Mono fonts with the plugin allowing adding 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. For my test I used By creating a custom rendering profile for PDF export with CSS Text (see Rendering-Profiles-Settings): @font-face {
font-family: 'noto-cjk';
src: url('file:///Users/vlad/src/fonts/arialuni.ttf');
font-weight: normal;
font-style: normal;
}
.markdown-body,
.wiki-body {
font-family: 'noto-sans', 'noto-cjk', Arial, "Helvetica Neue", "Segoe UI", freesans, sans-serif;
font-size: 16px;
line-height: 1.6;
}
var,
code,
kbd,
pre {
font: 0.9em 'noto-mono', Consolas,Inconsolata,Courier,monospace;
} And turning off all stylesheets and turning off HTML Generation option: Then setting Rendering Settings PDF profile to the above created rendering profile so PDF uses the custom CSS and HTML Generation. The following markdown: 1. 0.40.68 test
------------
## Reply
Я ожидал увидеть в PDF текст и изображения такие же, как в превью
плагина, но что-то пошло не так
`Я ожидал`
```puml
A -> D
```
| 字段名 | 说明 | 是否必须 | 备注 |
|---------|:----------------------------|---------|--------|
| status | 状态码 | 是 | String |
| result | 内容主体 | 否 | Object |
| message | 异常情况的错误信息,供显示给用户 | 否 | String |
[ ]
异常情 况 的 错误 信息, mixed chars width wrapping mode test 供显 示给用户
异常情况的 错 误信息 供显 示给 用户 异常情 况的错误 信息,供显示给用户
异常情况的错 误信息,供显 示给用户 异常情况 的错误信息,供显示给用户 异常 情况的
错 误 信息,供显 示给 用户 Renders in PDF as: Exports to PDF 533.pdf I will post here when the EAP is available for download. |
EAP update with a fix for the issue is available. (see Rendering-Profiles-Settings) |
it is not work for me, plugin version is 3.0.197.72 |
@HZ89, what exactly is not working for you? What OS and IDE are you using? |
The text was updated successfully, but these errors were encountered: