1
问题与报告的here相同。iText PDF失败并显示消息“Dictionary key endstream is not a name”
我已经采取this image和使用GraphicsMagick工具v1.3.26转换为this PDF(建于2017年7月4日):
gm convert itext_banner_InvalidPdfException.jpg itext_banner_InvalidPdfException.pdf
当我试着使用iText的v5.5.12读它,我得到的以下情况除外:
java -cp itextpdf-5.5.12.jar com.itextpdf.text.pdf.parser.PdfContentReaderTool itext_banner_InvalidPdfException.pdf
com.itextpdf.text.exceptions.InvalidPdfException: Rebuild failed: Dictionary key endstream is not a name. at file pointer 1197; Original message: Dictionary key endstream is not a name. at file pointer 1197
at com.itextpdf.text.pdf.PdfReader.readPdf(PdfReader.java:764)
at com.itextpdf.text.pdf.PdfReader.<init>(PdfReader.java:197)
at com.itextpdf.text.pdf.PdfReader.<init>(PdfReader.java:235)
at com.itextpdf.text.pdf.PdfReader.<init>(PdfReader.java:223)
at com.itextpdf.text.pdf.PdfReader.<init>(PdfReader.java:213)
at com.itextpdf.text.pdf.parser.PdfContentReaderTool.listContentStream(PdfContentReaderTool.java:200)
at com.itextpdf.text.pdf.parser.PdfContentReaderTool.main(PdfContentReaderTool.java:249)
问题:
- 给定PDF究竟有什么错误?看起来GhostScript中存在一个GraphicsMagick间接使用的问题。
- 当我用iText RUPS v5.8.8打开它时,它不会打印任何警告控制台选项卡。这是否意味着它从iText RUPS的角度来看是有效的?
你碰巧知道为什么iText RUPS不报告它?我认为它也是为此而设计的:恢复破碎的结构,但也要报告。 –
我稍后再看看。但我不希望RUPS专门处理这个错误。 – mkl