want to get the white text background color but incorrect, and the text RGB is incorrect 0,0,0, that should (255,255,255);
how to get the white text and backgroud color?
demo pdf
how to get the white text and backgroud color?
override def processTextPosition(text: TextPosition): Unit = {
super.processTextPosition(text)
val color: PDColor = getGraphicsState.getNonStrokingColor
val components: Array[Float] = color.getComponents
val r: Int = Math.round(components(0) * 255)
val g: Int = Math.round(components(1) * 255)
val b: Int = Math.round(components(2) * 255)
linePos.append((r, g, b))
if(r!=0||g!=0||b!=0) bad.append(text.getUnicode)
val color2: PDColor = getGraphicsState.getStrokingColor
val components2: Array[Float] = color2.getComponents
if (components2.size >= 3){
val r2: Int = Math.round(components2(0) * 255)
val g2: Int = Math.round(components2(1) * 255)
val b2: Int = Math.round(components2(2) * 255)
if (r2 != 0 || g2 != 0 || b2 != 0) bad.append(text.getUnicode)
}
}