u010360297
want2beA_BATer
2017-07-17 06:58

iText将html转换成pdf文件

  • java
  • pdf
  • linux
  • itext pdf

已经用Jsoup处理过html文件,所以htnl文件格式绝对是规范的,在windows和MacOX系统上转换都正常,但是在linux上运行转换提示出错:
RuntimeWorkerException: Invalid nested tag p found, expected closing tag span.
at com.itextpdf.tool.xml.XMLWorker.endElement(XMLWorker.java:134)
at com.itextpdf.tool.xml.parser.XMLParser.endElement(XMLParser.java:396)
at com.itextpdf.tool.xml.parser.state.ClosingTagState.process(ClosingTagState.java:70)
at com.itextpdf.tool.xml.parser.XMLParser.parseWithReader(XMLParser.java:236)
at com.itextpdf.tool.xml.parser.XMLParser.parse(XMLParser.java:214)
at com.itextpdf.tool.xml.parser.XMLParser.parse(XMLParser.java:203)
at com.itextpdf.tool.xml.XMLWorkerHelper.parseXHtml(XMLWorkerHelper.java:236)
at com.itextpdf.tool.xml.XMLWorkerHelper.parseXHtml(XMLWorkerHelper.java:210)
at com.itextpdf.tool.xml.XMLWorkerHelper.parseXHtml(XMLWorkerHelper.java:187)
at com.embraiz.util.file.DownFile.produceReport(DownFile.java:466)
at com.embraiz.controller.ReportDataController.produceReport(ReportDataController.java:628)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke
(InvocableHandlerMethod.java:219)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest
...
求解答,急~

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答