pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: PDFBox gets wrong font color values from PDF file!
Date Mon, 07 Jan 2019 16:55:10 GMT
Hi,

Please use the PrintTextColors example and combine this to your code, 
then show where these colors come up, i.e. for what glyph. Hopefully at 
the beginning or at the end of the output.

Tilman

Am 07.01.2019 um 10:22 schrieb Hesham Gneady:
> Hello,
>
>   
>
> In this sample PDF file:
>
> https://www.dropbox.com/s/2z5b3vrvnzjo0lo/Font%20color%20Sample.pdf?dl=0
>
> 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:
>
>      @Override
>
>      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,
>
> Hesham
>
>   
>
>   
>
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message