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