OpenPDF
OpenPDF copied to clipboard
ClassCastException in PdfReader.consolidateNamedDestinations: com.lowagie.text.pdf.PdfArray cannot be cast to class com.lowagie.text.pdf.PdfString
I get this ClassCastException in OpenPDF version 1.3.27:
java.lang.ClassCastException: class com.lowagie.text.pdf.PdfArray cannot be cast to class com.lowagie.text.pdf.PdfString (com.lowagie.text.pdf.PdfArray and com.lowagie.text.pdf.PdfString are in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader @6c901f0e) at com.lowagie.text.pdf.PdfNameTree.iterateItems(PdfNameTree.java:157) at com.lowagie.text.pdf.PdfNameTree.iterateItems(PdfNameTree.java:163) at com.lowagie.text.pdf.PdfNameTree.readTree(PdfNameTree.java:171) at com.lowagie.text.pdf.PdfReader.getNamedDestinationFromStrings(PdfReader.java:2876) at com.lowagie.text.pdf.PdfReader.getNamedDestination(PdfReader.java:2814) at com.lowagie.text.pdf.PdfReader.consolidateNamedDestinations(PdfReader.java:3057)
https://github.com/LibrePDF/OpenPDF/blob/master/openpdf/src/main/java/com/lowagie/text/pdf/PdfNameTree.java#L157
hi Andreas, would you have a pdf to test? Looks like a sort error in the pdf itself which needs to be catched.
I have such as a PDF file to reproduce this problem, can you please send me an email to andreas.rosdal AT gmail.com and I will share the PDF file with you. Thank you.
@koenvb
Hi, il there any news about this problem ?
This bug is still present in OpenPDF 1.3.30. @guyruisseau (Still same stack trace)