ICEpdf
  1. ICEpdf
  2. PDF-302

ClassCastException: java.util.Hashtable cannot be cast to org.icepdf.core.pobjects.Stream

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.2, 4.2.1
    • Fix Version/s: 4.2.2
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      All

      Description

      The following error is thrown when trying to render an image in a customer PDF:

      Jun 7, 2011 2:15:59 PM org.icepdf.core.pobjects.Resources getImage
      FINE: Error getting image by name: Im7
      java.lang.ClassCastException: java.util.Hashtable cannot be cast to org.icepdf.core.pobjects.Stream
              at org.icepdf.core.pobjects.Stream.jbig2Decode(Stream.java:846)
              at org.icepdf.core.pobjects.Stream.getImage(Stream.java:2121)
              at org.icepdf.core.pobjects.Stream.getImage(Stream.java:2032)
              at org.icepdf.core.pobjects.Resources.getImage(Resources.java:264)
              at org.icepdf.core.util.ContentParser.parse(ContentParser.java:478)
              at org.icepdf.core.pobjects.Page.init(Page.java:390)
              at org.icepdf.core.views.swing.PageViewComponentImpl$PageInitilizer.run(PageViewComponentImpl.java:1077)
              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:619)

        Activity

        Arran Mccullough created issue -
        Arran Mccullough made changes -
        Field Original Value New Value
        Salesforce Case [5007000000Gw49p]
        Hide
        Patrick Corless added a comment -

        The PDF generator in question is doing a strange circular reference when specifying an JBIG2 images JBIG2Globals. Basically the reference points back to the original image which is incorrect. Normally if no JBIG2Globals are specified the value should be null or omitted.

        Good news is that it's an easy fix to get the Image in question to render correctly.

        Show
        Patrick Corless added a comment - The PDF generator in question is doing a strange circular reference when specifying an JBIG2 images JBIG2Globals. Basically the reference points back to the original image which is incorrect. Normally if no JBIG2Globals are specified the value should be null or omitted. Good news is that it's an easy fix to get the Image in question to render correctly.
        Patrick Corless made changes -
        Fix Version/s 4.2.2 [ 10265 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24862 Wed Jun 22 12:17:26 MDT 2011 patrick.corless PDF-302 added an instance of check for jbigGlobals stream object, sample pdf in question linked back the the image resources isntead which cause a parsing error and display issue.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/Stream.java
        Hide
        Patrick Corless added a comment -

        Added instance of check to make sure we get the correct jbigGlobals instance.

        Show
        Patrick Corless added a comment - Added instance of check to make sure we get the correct jbigGlobals instance.
        Patrick Corless made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: