|
|
@@ -95,8 +95,8 @@ public class HtmlConvertPdf {
|
|
|
//引入指定字体,注意字体名需要和css样式中指定的字体名相同
|
|
|
String fontPath = HtmlConvertPdf.class.getClassLoader().getResource("").getPath().concat("font");
|
|
|
System.out.println(fontPath);
|
|
|
- builder.useFont(new File(fontPath + "/simsun.ttf"), "SimSun", 1, BaseRendererBuilder.FontStyle.NORMAL, true);
|
|
|
- builder.useFont(new File(fontPath + "/simfang.ttf"), "simfang", 1, BaseRendererBuilder.FontStyle.NORMAL, true);
|
|
|
+ builder.useFont(new File(fontPath + "/simsun.ttf"), "SimSun", 0, BaseRendererBuilder.FontStyle.NORMAL, true);
|
|
|
+ builder.useFont(new File(fontPath + "/simfang.ttf"), "simfang", 0, BaseRendererBuilder.FontStyle.NORMAL, true);
|
|
|
builder.run();
|
|
|
}
|
|
|
}
|