Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-1681

java.lang.IllegalArgumentException: Color parameter outside of expected range: Red

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 1.8.3, 2.0.0
    • Component/s: PDModel
    • Labels:
      None

      Description

      When calling page.convertToImage() for a pdf file from the ghostscript installation, I get this stack trace:
      06.08.2013 11:46:52.086 WARN [main] org.apache.pdfbox.pdmodel.graphics.color.PDColorState:244 - Unable to create the color instance [74.0, 0.0, 0.0] in color space Lab{ }; guessing color ...
      Color interpolation failed; using black instead
      java.lang.IllegalArgumentException: Color parameter outside of expected range: Red
      java.lang.IllegalArgumentException: Color parameter outside of expected range: Component 0
      at java.awt.Color.<init>(Color.java:538)
      at org.apache.pdfbox.pdmodel.graphics.color.PDColorState.createColor(PDColorState.java:190)
      at org.apache.pdfbox.pdmodel.graphics.color.PDColorState.getJavaColor(PDColorState.java:121)
      at org.apache.pdfbox.pdfviewer.PageDrawer.processTextPosition(PageDrawer.java:216)
      at org.apache.pdfbox.util.PDFStreamEngine.processEncodedText(PDFStreamEngine.java:485)
      at org.apache.pdfbox.util.operator.ShowText.process(ShowText.java:45)
      at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:529)
      at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:258)
      at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:225)
      at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:205)
      at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:141)
      at org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:781)
      at pdfboxpageimageextraction.ExtractImages.doPdf(ExtractImages.java:118)
      at pdfboxpageimageextraction.ExtractImages.main(ExtractImages.java:67)

      The file is rendered, but the color of the third text is incorrect.

        Attachments

        1. text_graphic_image.pdf
          131 kB
          Tilman Hausherr
        2. text_graphic_image-01.png
          363 kB
          Tilman Hausherr

          Issue Links

            Activity

              People

              • Assignee:
                lehmi Andreas Lehmkühler
                Reporter:
                tilman Tilman Hausherr
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: