D.F. Stones
D.F. Stones

Reputation: 91

PDFBox 2.0: how to detect bold text here

I know there many ways to do bold text in PDF, most common are "bold" keywords in TextPosition.getFont(). However, in attached document I was not able to find why that bold text is actually bold:

capture of pdf

enter image description here

Visually it looks like each character is duplicated twice, however, I don't see that in TextStripper.writeString Is there anything else can make text bold? thanks in advance!

Upvotes: 2

Views: 761

Answers (1)

Tilman Hausherr
Tilman Hausherr

Reputation: 18896

Your file uses text rendering mode 2 (fill and stroke, aka RenderingMode.FILL_STROKE). This simulates bold. You can get the current mode by calling getGraphicsState().getTextState().getRenderingMode() in a class that extends the stripper.

Upvotes: 1

Related Questions