Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 4.2
-
Fix Version/s: 4.2.2
-
Component/s: Core/Parsing
-
Labels:None
-
Environment:-
Description
Some pages in the attached PDF (ex. page 211) do not render due to the following exception:
Mar 21, 2011 1:13:43 PM org.icepdf.core.pobjects.Page init
FINE: Error initializing Page.
java.lang.IllegalArgumentException: negative dash phase
at java.awt.BasicStroke.<init>(BasicStroke.java:195)
at org.icepdf.core.util.ContentParser.setStroke(ContentParser.java:2512)
at org.icepdf.core.util.ContentParser.consume_d(ContentParser.java:1988)
at org.icepdf.core.util.ContentParser.parse(ContentParser.java:600)
at org.icepdf.core.pobjects.Page.init(Page.java:369)
at org.icepdf.core.views.swing.PageViewComponentImpl$PageInitilizer.run(PageViewComponentImpl.java:1088)
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:680)
Mar 21, 2011 1:13:43 PM org.icepdf.core.pobjects.Page init
FINE: Error initializing Page.
java.lang.IllegalArgumentException: negative dash phase
at java.awt.BasicStroke.<init>(BasicStroke.java:195)
at org.icepdf.core.util.ContentParser.setStroke(ContentParser.java:2512)
at org.icepdf.core.util.ContentParser.consume_d(ContentParser.java:1988)
at org.icepdf.core.util.ContentParser.parse(ContentParser.java:600)
at org.icepdf.core.pobjects.Page.init(Page.java:369)
at org.icepdf.core.views.swing.PageViewComponentImpl$PageInitilizer.run(PageViewComponentImpl.java:1088)
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:680)
Not very often I get to to quote the PDF specification twice in one day but here we are. The document in question is contains was generated by Acrobat PRO 9.2.0. For some reason the dash phase for 211 is a negative number which is against the spec and causes Java2D some grief.
Altered the content parser to take the absolute value of the dash phase and dash vector values. The page in question renders correctly after the change with no noticeable issues with the dashed lines on the page.