Java Web应用程序的https://github.com/wooio/htmltopdf-java前提条件

问题描述

是否需要为此安装wkhtmltopdf.exe?因为wkhtmltopdfloader类从系统库中查找并实例化。我很困惑。我需要像下面这样调用页眉和页脚的html网址:

    {boolean success = HtmlToPdf.create()
             .object(HtmlToPdfObject.forHtml(contractText).defaultEncoding("UTF-8")
                    .headerHtmlUrl("D:\\header.html")            
                    .footerHtml("D:\\footer.html"))
                .convert("D:\\ITextTest.pdf");}

我收到以下错误消息:

    {java.lang.NullPointerException
at java.util.Objects.requireNonNull(Unknown Source)
at java.nio.file.Files.copy(Unknown Source)
at com.homeinspectorpro.serverless.hipofficemanager.util.htmltopdf.wkhtmltopdf.WkHtmlToPdfLoader.load(WkHtmlToPdfLoader.java:33) // Files.copy(in,libraryFile.toPath(),//StandardCopyOption.REPLACE_EXISTING); this line
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)