ICEpdf
  1. ICEpdf
  2. PDF-586

String cannot be cast to org.icepdf.core .pobjects.Stream

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.1
    • Fix Version/s: 5.0.2, 5.0.3
    • Component/s: None
    • Labels:
      None
    • Environment:
      Pro, JAI
    • Salesforce Case Reference:

      Description

      The PDF renders correctly but the following is thrown on page 2:

      WARNING: Error initiating page: 2
      java.lang.ClassCastException: java.lang.String cannot be cast to org.icepdf.core
      .pobjects.Stream
      at org.icepdf.core.pobjects.Page.initPageContents(Page.java:231)
      at org.icepdf.core.pobjects.Page.init(Page.java:335)
      at org.icepdf.ri.common.views.PageViewComponentImpl$PageInitializer.run(PageVie
      wComponentImpl.java:1008)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.ja
      va:895)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:9
      18)
      at java.lang.Thread.run(Thread.java:680)
      java.lang.ClassCastException: java.lang.String cannot be cast to org.icepdf.core
      .pobjects.Stream
      at org.icepdf.core.pobjects.Page.initPageContents(Page.java:231)
      at org.icepdf.core.pobjects.Page.init(Page.java:335)
      at org.icepdf.ri.common.views.PageViewComponentImpl$PageInitializer.run(PageVie
      wComponentImpl.java:1008)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.ja
      va:895)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:9
      18)
      at java.lang.Thread.run(Thread.java:680)

        Activity

        Patrick Corless made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Hide
        Patrick Corless added a comment -

        Verified with final bundle

        Show
        Patrick Corless added a comment - Verified with final bundle
        Patrick Corless made changes -
        Fix Version/s 5.0.3 [ 11070 ]
        Fix Version/s 5.1 [ 10675 ]
        Patrick Corless made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 5.0.2 [ 10972 ]
        Fix Version/s 5.1 [ 10675 ]
        Resolution Fixed [ 1 ]
        Hide
        Patrick Corless added a comment -

        Updated 5.0.1 branch and trunk with batch.

        Show
        Patrick Corless added a comment - Updated 5.0.1 branch and trunk with batch.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #35547 Thu May 23 10:39:44 MDT 2013 patrick.corless PDF-586 update content stream assembly to make sure Stream object instance is checked before parsing begins.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/Page.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #35546 Thu May 23 10:38:07 MDT 2013 patrick.corless PDF-586 update content stream assembly to make sure Stream object instance is checked before parsing begins.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/Page.java
        Hide
        Patrick Corless added a comment -

        The file in question is malformed, on the third page there the content stream is specified by the object stream 16 0 obj which is not properly terminated. My guess is that there is an issue with the PDF encoder PDF-XChange when no content is specified for a page. The issue is pretty easy to compensate for with a few checks in the page class. I won't look to fix this at the parser level as it is an odd corner case that we've never seen before.

        Show
        Patrick Corless added a comment - The file in question is malformed, on the third page there the content stream is specified by the object stream 16 0 obj which is not properly terminated. My guess is that there is an issue with the PDF encoder PDF-XChange when no content is specified for a page. The issue is pretty easy to compensate for with a few checks in the page class. I won't look to fix this at the parser level as it is an odd corner case that we've never seen before.
        Tyler Johnson made changes -
        Attachment 12179.pdf [ 15893 ]
        Tyler Johnson made changes -
        Field Original Value New Value
        Salesforce Case Reference 5007000000T92tmAAB
        Tyler Johnson created issue -

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Tyler Johnson
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: