ICEpdf
  1. ICEpdf
  2. PDF-279

IllegalArgumentException: negative dash phase

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major 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)
      1. 9946.pdf
        4.42 MB
        Tyler Johnson

        Activity

        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24208 Mon Mar 21 08:12:02 MDT 2011 patrick.corless PDF-279 added Math.abs catch for the dash patter phase and vector numbers. Negative values are against the spec but we have a corner case where they are negative. Java2d also can't handle negative phase values.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/util/ContentParser.java
        Tyler Johnson created issue -
        Tyler Johnson made changes -
        Field Original Value New Value
        Attachment 9946.pdf [ 12991 ]
        Tyler Johnson made changes -
        Salesforce Case [5007000000G3hb0]
        Hide
        Patrick Corless added a comment -

        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.

        Show
        Patrick Corless added a comment - 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.
        Patrick Corless made changes -
        Fix Version/s 4.2.1 [ 10265 ]
        Hide
        Patrick Corless added a comment -

        Closing issue, no regressions in from qa.

        Show
        Patrick Corless added a comment - Closing issue, no regressions in from qa.
        Patrick Corless made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: