Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 5.1.1
-
Fix Version/s: 5.1.2
-
Component/s: Core/Parsing
-
Labels:None
-
Environment:All
-
Support Case References:Support Case #13249 - https://icesoft.my.salesforce.com/5007000000zNxuk
Description
When rendering the provided PDF file the following exception is thrown and the PDF does not render:
WARNING: Error parsing content stream.
java.lang.IllegalArgumentException: Color parameter outside of expected range: Red Green Blue
at java.awt.Color.testColorValueRange(Color.java:344)
at java.awt.Color.<init>(Color.java:462)
at org.icepdf.core.util.content.AbstractContentParser.consume_g(AbstractContentParser.java:185)
at org.icepdf.core.util.content.NContentParser.parse(Unknown Source)
at org.icepdf.core.pobjects.Page.init(Page.java:390)
at org.icepdf.ri.common.views.PageViewComponentImpl$PageInitializer.run(PageViewComponentImpl.java:1152)
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)
WARNING: Error parsing content stream.
java.lang.IllegalArgumentException: Color parameter outside of expected range: Red Green Blue
at java.awt.Color.testColorValueRange(Color.java:344)
at java.awt.Color.<init>(Color.java:462)
at org.icepdf.core.util.content.AbstractContentParser.consume_g(AbstractContentParser.java:185)
at org.icepdf.core.util.content.NContentParser.parse(Unknown Source)
at org.icepdf.core.pobjects.Page.init(Page.java:390)
at org.icepdf.ri.common.views.PageViewComponentImpl$PageInitializer.run(PageViewComponentImpl.java:1152)
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 PDF in question has gray colour value that is outside the expected range of 0->1.0. The value is actually -0.04 which is likely an issue with the PDF encoder.
Touched up the to protected against negative values.