|
|
@@ -117,8 +117,8 @@ public class HtmlConvertToPdf implements InitializingBean {
|
|
|
//引入指定字体,注意字体名需要和css样式中指定的字体名相同
|
|
|
String fontPath = HtmlConvertToPdf.class.getClassLoader().getResource("").getPath();
|
|
|
System.out.println(fontPath);
|
|
|
- builder.useFont(new File(fontPath + simsumPath.substring(simsumPath.indexOf("/") + 1)), "SimSun", 0, BaseRendererBuilder.FontStyle.NORMAL, true);
|
|
|
- builder.useFont(new File(fontPath + simfangPath.substring(simfangPath.indexOf("/") + 1)), "simfang", 0, BaseRendererBuilder.FontStyle.NORMAL, true);
|
|
|
+ builder.useFont(new File(fontPath + simsumPath.substring(simsumPath.indexOf("/") + 1)), "SimSun", 400, BaseRendererBuilder.FontStyle.NORMAL, true);
|
|
|
+ builder.useFont(new File(fontPath + simfangPath.substring(simfangPath.indexOf("/") + 1)), "simfang", 400, BaseRendererBuilder.FontStyle.NORMAL, true);
|
|
|
|
|
|
builder.run();
|
|
|
}
|