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

[PATCH] PDPageContentStream incorrectly sets colors in CMYK color space

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.8.0
    • None
    • 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

        1. bug-1469.patch
          6 kB
          Yegor Kozlov

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: