ICEpdf
  1. ICEpdf
  2. PDF-1078

NullPointerException at ShadingType2Pattern

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.1.3
    • Fix Version/s: 6.2
    • Component/s: Core/Rendering
    • Labels:
      None
    • Environment:
      All

      Description

      With the provided PDF file, an NPE is thrown and some of the content in the is not rendered.

      Error stack traces:

      Dec 01, 2016 2:19:36 PM org.icepdf.core.util.content.NContentParser parse
      WARNING: Error parsing content stream.
      java.lang.NullPointerException
      at org.icepdf.core.pobjects.graphics.ShadingType2Pattern.init(ShadingType2Pattern.java:137)
      at org.icepdf.core.util.content.AbstractContentParser.commonFill(AbstractContentParser.java:1895)
      at org.icepdf.core.util.content.AbstractContentParser.consume_f(AbstractContentParser.java:1100)
      at org.icepdf.core.util.content.NContentParser.parse(Unknown Source)
      at org.icepdf.core.pobjects.Form.init(Form.java:196)
      at org.icepdf.core.util.content.AbstractContentParser.consume_Do(AbstractContentParser.java:562)
      at org.icepdf.core.util.content.NContentParser.parse(Unknown Source)
      at org.icepdf.core.pobjects.Page.init(Page.java:403)
      at org.icepdf.ri.common.views.PageViewComponentImpl$PageInitializer.run(PageViewComponentImpl.java:1180)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)

      Dec 01, 2016 2:19:36 PM org.icepdf.core.util.content.NContentParser parse
      WARNING: Error parsing content stream.
      java.lang.NullPointerException
      at org.icepdf.core.pobjects.graphics.ShadingType2Pattern.init(ShadingType2Pattern.java:137)
      at org.icepdf.core.util.content.AbstractContentParser.commonFill(AbstractContentParser.java:1895)
      at org.icepdf.core.util.content.AbstractContentParser.consume_f(AbstractContentParser.java:1100)
      at org.icepdf.core.util.content.NContentParser.parse(Unknown Source)
      at org.icepdf.core.pobjects.Page.init(Page.java:403)
      at org.icepdf.ri.common.views.PageViewComponentImpl$PageInitializer.run(PageViewComponentImpl.java:1180)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)

        Activity

        Hide
        Patrick Corless added a comment -

        The first issue is related to an inheritance issue when the super API was changed the the instance init method of ShadingType1Pattern was not called. Once I correct the override problem then there is an error while parsing the type 4 function:

        {pop
        dup 0 le

        {pop 0 .447058856 .490196108 }
        {dup 1 le {pop 0 .447058856 .490196108 }

        {pop 0 .447058856 .490196108}

        ifelse
        } ifelse
        }

        I'll can come back to verify if there is actually an issue with the function or if its on our end. This type of validation takes a ton of time. With a little more code protection the PDF renders fine.

        Show
        Patrick Corless added a comment - The first issue is related to an inheritance issue when the super API was changed the the instance init method of ShadingType1Pattern was not called. Once I correct the override problem then there is an error while parsing the type 4 function: {pop dup 0 le {pop 0 .447058856 .490196108 } {dup 1 le {pop 0 .447058856 .490196108 } {pop 0 .447058856 .490196108} ifelse } ifelse } I'll can come back to verify if there is actually an issue with the function or if its on our end. This type of validation takes a ton of time. With a little more code protection the PDF renders fine.
        Hide
        Patrick Corless added a comment -

        Marking as fixed.

        Show
        Patrick Corless added a comment - Marking as fixed.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: