Your example shows the same color, not different colors, and all yellow
(red + green = yellow in the RGB model)
Maybe upload the pdf somewhere (it can't be attached here)
Tilman
Am 19.08.2014 15:41, schrieb Nicholas Poon:
Hi, actually I tried with getR, getG and getB before but it seems like the
numbers returned are not talking about the color of the highlighted text box. I
just highlighted the text by Adobe Reader with default yellow color, red and
blue color at different area. One strange thing is even I am using same color
(e.g. yellow) to highlight at different areas, the PDGamma strings returned
with different values.
For getR, getG and getB, I can only get 1 or 0, but not hex-codes or decimal
figures for RGB conversion.
I wish to get the highlighted text area color but not the text color, any
further hints? Thanks.
System.out.println(pdfAnnot.getColour());
System.out.format("getR(): %f%n", pdfAnnot.getColour().getR());
System.out.format("getG(): %f%n", pdfAnnot.getColour().getG());
System.out.format("getB(): %f%n", pdfAnnot.getColour().getB());
org.apache.pdfbox.pdmodel.graphics.color.PDGamma@643b1d11
getR(): 1.000000
getG(): 1.000000
getB(): 0.000000
org.apache.pdfbox.pdmodel.graphics.color.PDGamma@5034c75a
getR(): 1.000000
getG(): 1.000000
getB(): 0.000000
org.apache.pdfbox.pdmodel.graphics.color.PDGamma@62ee68d8
getR(): 1.000000
getG(): 1.000000
getB(): 0.000000