【发布时间】:2016-08-05 11:14:45
【问题描述】:
我有一个 PHP 应用程序,它通过数据库调用填写表单。目前我正在使用 PDFtk 将其组合在一起,我能够毫无问题地运行许多 PDFtk 命令,并且我目前正在命令行上制定所需的命令。
我的电话目前是这样的:
pdftk /var/www/html/CSR/template/job_card.pdf fill_form /var/www/html/CSR/template/wwwwu7mMH.fdf output /var/www/html/CSR/template/filled4.pdf
这个确切的调用多次运行有时会产生这个错误:
Unhandled Java Exception in create_output():
java.lang.ClassCastException: pdftk.com.lowagie.text.pdf.PdfNull cannot be cast to pdftk.com.lowagie.text.pdf.PdfDictionary
at pdftk.com.lowagie.text.pdf.FdfReader.readFields(pdftk)
at pdftk.com.lowagie.text.pdf.FdfReader.readPdf(pdftk)
at pdftk.com.lowagie.text.pdf.PdfReader.<init>(pdftk)
at pdftk.com.lowagie.text.pdf.PdfReader.<init>(pdftk)
at pdftk.com.lowagie.text.pdf.FdfReader.<init>(pdftk)
有时会出现这个错误:
Unhandled Java Exception in create_output():
Unhandled Java Exception in main():
java.lang.NullPointerException
at gnu.gcj.runtime.NameFinder.lookup(libgcj.so.10)
at java.lang.Throwable.getStackTrace(libgcj.so.10)
at java.lang.Throwable.stackTraceString(libgcj.so.10)
at java.lang.Throwable.printStackTrace(libgcj.so.10)
at java.lang.Throwable.printStackTrace(libgcj.so.10)
错误消息交替出现,但命令永远不会起作用并且表单永远不会被填写。正如我所说,PDFtk 可以与其他命令一起使用,我已经能够生成加密的 PDF 并成功运行固定命令。
我的问题是导致此错误的原因以及如何解决?
【问题讨论】: