{file src=new文件(“/home/info/documents/prototypeimpl(1)/prototypeimpl/src/main/resources/templates/terms\u new.html”);file dest=new file(“/home/info/documents/prototypeimpl(1)/prototypeimpl/src/main/resources/generatedpdfs/termsa4112123size”);
PdfDocument pdf = new PdfDocument(new PdfWriter(dest));
Document doc = new Document(pdf, PageSize.A4);
InputStream stream = new FileInputStream(src);
ConverterProperties converterProperties = new ConverterProperties();
FontProvider dfp = new DefaultFontProvider(true, true, true);
converterProperties.setFontProvider(dfp);
PdfFont font = PdfFontFactory.createFont(FontConstants.HELVETICA_BOLD);
HtmlConverter.convertToPdf(stream, pdf, converterProperties);
}
暂无答案!
目前还没有任何答案,快来回答吧!