|
@@ -94,6 +94,7 @@ public class HtmlConvertPdf {
|
|
|
|
|
|
|
|
//引入指定字体,注意字体名需要和css样式中指定的字体名相同
|
|
//引入指定字体,注意字体名需要和css样式中指定的字体名相同
|
|
|
String fontPath = HtmlConvertPdf.class.getClassLoader().getResource("").getPath().concat("font");
|
|
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 + "/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 + "/simfang.ttf"), "simfang", 1, BaseRendererBuilder.FontStyle.NORMAL, true);
|
|
|
builder.run();
|
|
builder.run();
|