Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 6.1.3
-
Fix Version/s: 6.2
-
Component/s: Core/Rendering
-
Labels:None
-
Environment:All
-
Support Case References:Support Case #13956 - https://icesoft.my.salesforce.com/5007000001fu7cb
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)
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)
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
{pop 0 .447058856 .490196108 }dup 0 le
{dup 1 le {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.