ICEpdf
  1. ICEpdf
  2. PDF-883

IllegalArgumentException: alpha value out of range

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.1.2
    • Fix Version/s: 6.0
    • Component/s: Core/Rendering
    • Labels:
      None
    • Environment:
      ICEpdf 5.1.2 P03

      Description

      With the provided PDF file, some pages are rendered white/blank. The following errors are reported in the logs:

      FINEST: Error parsing text block
      java.lang.IllegalArgumentException: alpha value out of range
      at java.awt.AlphaComposite.<init>(AlphaComposite.java:624)
      at java.awt.AlphaComposite.getInstance(AlphaComposite.java:689)
      at org.icepdf.core.util.content.AbstractContentParser.setAlpha(AbstractContentParser.java:1915)
      at org.icepdf.core.util.content.AbstractContentParser.consume_Tj(AbstractContentParser.java:1405)
      at org.icepdf.core.util.content.NContentParser.parseText(Unknown Source)
      at org.icepdf.core.util.content.NContentParser.parse(Unknown Source)
      at org.icepdf.core.pobjects.Page.init(Page.java:392)
      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)

      May 11, 2015 9:33:11 AM org.icepdf.core.util.content.NContentParser parse
      WARNING: Error parsing content stream.
      java.lang.IllegalArgumentException: alpha value out of range
      at java.awt.AlphaComposite.<init>(AlphaComposite.java:624)
      at java.awt.AlphaComposite.getInstance(AlphaComposite.java:689)
      at org.icepdf.core.util.content.AbstractContentParser.setAlpha(AbstractContentParser.java:1915)
      at org.icepdf.core.util.content.AbstractContentParser.commonFill(AbstractContentParser.java:1793)
      at org.icepdf.core.util.content.AbstractContentParser.consume_f(AbstractContentParser.java:1050)
      at org.icepdf.core.util.content.NContentParser.parse(Unknown Source)
      at org.icepdf.core.pobjects.Page.init(Page.java:392)
      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)

        Activity

        Hide
        Patrick Corless added a comment -

        The postscript in question is part of an external graphics state definition, /ca 255. Normally the range of values is 0-1.0 but for some reason this PDF does 255 which seems to be an error in the encoder. 255 is commonly used for in exchange for 1.0 in many different colour models.

        I've added some code protection around alpha fill and stroke and will convert to 0-255 to 0-1.0. PDF renders correctly no.

        Show
        Patrick Corless added a comment - The postscript in question is part of an external graphics state definition, /ca 255. Normally the range of values is 0-1.0 but for some reason this PDF does 255 which seems to be an error in the encoder. 255 is commonly used for in exchange for 1.0 in many different colour models. I've added some code protection around alpha fill and stroke and will convert to 0-255 to 0-1.0. PDF renders correctly no.
        Hide
        Patrick Corless added a comment -

        Marking as fixed.

        Show
        Patrick Corless added a comment - Marking as fixed.
        Hide
        Patrick Corless added a comment -

        Marking as closed

        Show
        Patrick Corless added a comment - Marking as closed

          People

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

            Dates

            • Created:
              Updated:
              Resolved: