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

ColorSpace validation fails for inlined image

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.11
    • 1.8.12
    • Preflight
    • None

    Description

      Validation fails for inlined image if content stream for inline image specifies color space using abbreviated name (ex. /CMYK instead of /DeviceCMYK):

      BI
      /CS/CMYK
      /W 34
      /H 36
      /BPC 8
      /F/Fl
      /DP<</Predictor 15
      /Columns 34
      /Colors 4>>

      ID x£ĒŚ...
      EI

      In this case Preflight validation fails with this message:

      2.3.2 : Unexpected key in Graphic object definition, The ColorSpace is unknown

      PDF Reference v1.4 Chapter 4.8.6 table 4.40 indicates the abbreviations for the names of color spaces, which could be used to represent color spaces for inlined images instead of using the full names. There abbreviation CMYK matches full name DeviceCMYK.

      The culprit is that ContentStreamEngine looks for the corresponding ColorSpaces enum constant by matching its name to the specified color space name in content stream (i.e. using Enum.valueOf()). While ColorSpaces enum class has constants for abbreviated names, they are stored in local variable label and do not correspond to the enum constant name.

      Attachments

        1. PDFA-RGB.pdf
          23 kB
          Tilman Hausherr
        2. FIX__ColorSpaces_for_inlined_image.patch
          3 kB
          Petras

        Activity

          People

            tilman Tilman Hausherr
            abyss Petras
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: