-
Notifications
You must be signed in to change notification settings - Fork 391
Description
Hi there,
I was using the Flying Saucer library before and it all went ok until I upgrade my Spring framework to v5 so that I have to look for a newer library to generate PDF with Chinese in it.
I had read quite a few posts and tried many ways, but still seeing ###. Not sure what is going on. Do I miss any step?
Please help.
My css file:
@charset "UTF-8";
@font-face {
font-family: "Arial Unicode MS";
src: url('arialuni.ttf');
}
- {
font-family: "Arial Unicode MS",sans-serif;
}
HTML file:
<title>Testing</title>每星期三
Every Wednesday
Java:
public static void main(String[] args) throws Exception {
try (OutputStream os = new FileOutputStream("E:/Temp/out.pdf")) {
PdfRendererBuilder builder = new PdfRendererBuilder();
// builder.useFont(new File("E:/Temp/arialuni.ttf"),"Arial Unicode MS");
builder.useFastMode();
builder.withUri("file:///E:/Temp/index.html");
builder.toStream(os);
builder.run();
}
}
Result:
