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

[PATCH] PDPageContentStream incorrectly sets colors in CMYK color space

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.8.0
    • Component/s: None
    • Labels:
      None

      Description

      I have a program that reads graphic commands from a postscript file and draws a logo on existing PDF pages.
      PDF commands are written using PDPageContentStream which works OK except when I pass colors in CMYK color space - in this case the colors are "off".

      It appears that setStrokingColor(Color color) and setNonStrokingColor(Color color) set the magenta component wrong, they pass yellow instead.

      Here is the problematic line. Notice the second argument, it should be colorComponents[1], not colorComponents[2]

        setStrokingColor( colorComponents[0], colorComponents[2], colorComponents[2], colorComponents[3] );
      
      

      The patch and a unit test are attached.

      Regards,
      Yegor

        Attachments

          Activity

            People

            • Assignee:
              lehmi Andreas Lehmkühler
              Reporter:
              yegor.kozlov Yegor Kozlov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: