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

PDColorSpace#create IOException, expected a name or array but got COSDictionary

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.19
    • 2.0.20, 3.0.0 PDFBox
    • PDModel, Rendering
    • None
    • openjdk version "1.8.0_252", pdfbox-2.0.19

    Description

      When ever i am try to convert pdf to images. I am getting the followed exception. how to get rid of it.

       

      Stack trace:

       

      Exception in thread "main" java.io.IOException: Expected a name or array but got: COSDictionary{COSName

      {ColorSpace}

      :COSName{DeviceRGB};}
      at org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace.create(PDColorSpace.java:223)
      at org.apache.pdfbox.pdmodel.PDResources.getColorSpace(PDResources.java:199)
      at org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace.create(PDColorSpace.java:120)
      at org.apache.pdfbox.pdmodel.PDResources.getColorSpace(PDResources.java:203)
      at org.apache.pdfbox.pdmodel.PDResources.getColorSpace(PDResources.java:169)
      at org.apache.pdfbox.contentstream.operator.color.SetNonStrokingDeviceRGBColor.process(SetNonStrokingDeviceRGBColor.java:39)
      at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:875)
      at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:509)
      at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:483)
      at org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:156)
      at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:270)
      at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:321)
      at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:243)
      at org.apache.pdfbox.rendering.PDFRenderer.renderImageWithDPI(PDFRenderer.java:215)

      Attachments

        1. 13052020-135217676-1029.pdf
          195 kB
          krishna prasad
        2. screenshot-1.png
          32 kB
          Tilman Hausherr

        Issue Links

          Activity

            People

              tilman Tilman Hausherr
              krishnakittu528 krishna prasad
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: