Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 4.0.1
-
Fix Version/s: 4.1.1
-
Component/s: None
-
Labels:None
-
Environment:-
Description
The second page in the attached PDF does not display and the following exception is thrown:
FINE: Error initializing Page.
java.lang.ClassCastException: org.icepdf.core.pobjects.Name cannot be cast to org.icepdf.core.pobjects.Stream
at org.icepdf.core.pobjects.fonts.nfont.Font.init(Unknown Source)
at org.icepdf.core.pobjects.Resources.getFont(Resources.java:234)
at org.icepdf.core.util.ContentParser.consume_Tf(ContentParser.java:2020)
at org.icepdf.core.util.ContentParser.parseText(ContentParser.java:1147)
at org.icepdf.core.util.ContentParser.parse(ContentParser.java:280)
at org.icepdf.core.pobjects.Page.init(Page.java:369)
at org.icepdf.core.views.swing.PageViewComponentImpl$PageInitilizer.run(PageViewComponentImpl.java:1088)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:637)
FINE: Error initializing Page.
java.lang.ClassCastException: org.icepdf.core.pobjects.Name cannot be cast to org.icepdf.core.pobjects.Stream
at org.icepdf.core.pobjects.fonts.nfont.Font.init(Unknown Source)
at org.icepdf.core.pobjects.Resources.getFont(Resources.java:234)
at org.icepdf.core.util.ContentParser.consume_Tf(ContentParser.java:2020)
at org.icepdf.core.util.ContentParser.parseText(ContentParser.java:1147)
at org.icepdf.core.util.ContentParser.parse(ContentParser.java:280)
at org.icepdf.core.pobjects.Page.init(Page.java:369)
at org.icepdf.core.views.swing.PageViewComponentImpl$PageInitilizer.run(PageViewComponentImpl.java:1088)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:637)
It appears the problem is related to a jbig2 images encoded on the second page. The image in question doesn't have a JBIG2Globals entry in the DecodeParms dictionary which causes the error.
Touched up our code to better handle the missing attribute and all seems to be good.