-
Notifications
You must be signed in to change notification settings - Fork 369
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
含有中文字符的html输出pdf有乱码 #129
Comments
(Although I understand it's not always easy, it would help if you wrote these issues in English.) Google Translate says that this is what you've written means:
It works, but you need to make sure the font you're using supports the characters you're using. I'm not sure where to find TTF fonts with Chinese characters that you'd like to use, but Google seem to have a few available here: https://fonts.google.com/earlyaccess Here is an example (with PdfRendererBuilder builder = new PdfRendererBuilder();
// ...
builder.useFont(new FSSupplier<InputStream>() {
@Override
public InputStream supply() {
return new FileInputStream("cwTeXFangSong-zhonly.ttf");
}
}, "cwTeXFangSong", 400, FontStyle.NORMAL, true); Then, in your HTML/CSS: html {
font-family: "cwTeXFangSong", "Open Sans";
} (You can use multiple fonts in the |
有支持中文的计划吗?
The text was updated successfully, but these errors were encountered: