Details
Description
The attached (broken) file has this exception when displaying page 10:
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.io.IOException: Error: Unknown annotation type COSNull{}
org.apache.pdfbox.debugger.pagepane.PagePane$RenderWorker.done(PagePane.java:175)
sun.swing.AccumulativeRunnable.run(Unknown Source)
java.security.AccessController.doPrivileged(Native Method)
java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
Caused by: java.util.concurrent.ExecutionException: java.io.IOException: Error: Unknown annotation type COSNull{}
org.apache.pdfbox.debugger.pagepane.PagePane$RenderWorker.done(PagePane.java:164)
sun.swing.AccumulativeRunnable.run(Unknown Source)
java.security.AccessController.doPrivileged(Native Method)
java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
Caused by: java.io.IOException: Error: Unknown annotation type COSNull{}
org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation.createAnnotation(PDAnnotation.java:164)
org.apache.pdfbox.pdmodel.PDPage.getAnnotations(PDPage.java:664)
org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:181)
org.apache.pdfbox.rendering.PDFRenderer.renderPage(PDFRenderer.java:208)
org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:139)
org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:68)
org.apache.pdfbox.debugger.pagepane.PagePane$RenderWorker.doInBackground(PagePane.java:155)
org.apache.pdfbox.debugger.pagepane.PagePane$RenderWorker.doInBackground(PagePane.java:138)
java.lang.Thread.run(Unknown Source)
The cause is this code:
public COSBase getObject( int index ) { Object obj = objects.get( index ); if( obj instanceof COSObject ) { obj = ((COSObject)obj).getObject(); } else if( obj instanceof COSNull ) { obj = null; } return (COSBase)obj; }
i.e. a COSObject that points to a COSNull object isn't returned as null, but as COSNull. COSDictionary.getDictionaryObject() does not have this bug.
Solution: remove the "else".
Attachments
Attachments
Issue Links
- is depended upon by
-
PDFBOX-3058 Support TIKA Migration to PDFBox 2.0
- Closed