简体   繁体   中英

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

在此处输入图片说明

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!

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM