pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hesham Gneady" <heshamgne...@gmail.com>
Subject PDFBox gets wrong font color values from PDF file!
Date Mon, 07 Jan 2019 09:22:05 GMT


In this sample PDF file:


I am trying to check the font colors for all letters, but I have noticed
that PDFBox gets colors with values partially different from the ones that I
see in Adobe Acrobat. I use this code:


    public void processTextPosition( TextPosition t )  {

      try {

             PDGraphicsState gs = getGraphicsState();

Color color = new Color( gs.getNonStrokingColor().toRGB() );

System.out.println( color.getRed() );

System.out.println( color.getGreen() );

System.out.println( color.getBlue() );        


       catch (IOException ioe) {}



For example PDFBox prints the values: 

Red:64, Green:96, Blue:172


While in Adobe Acrobat the values appear as:

Red:66, Green:105, Blue:178


Is there a reason for this?


Best regards,




This email has been checked for viruses by Avast antivirus software.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message