检测是否使用OCR从扫描的文档创建了PDF [pdfbox] [英] Detect if a PDF is created from a scanned document using OCR [pdfbox]
本文介绍了检测是否使用OCR从扫描的文档创建了PDF [pdfbox]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道是否使用OCR从扫描的文档中创建了PDF.
I would like to know if a PDF was created from a scanned document using OCR.
要使扫描文档中的文本可选,我想用透明颜色,特殊字体...写相同的文本...
To make the text from the scanned document selectable, I guess the same text is written using a transparent color, a special font, ...
我正在使用pdfbox,我查看了字体,颜色和许多其他属性,但没有发现任何特殊之处.
I'm using pdfbox and I looked at the font, the color, and many other properties and I didn't find anything special.
推荐答案
在我的情况下,文本呈现模式设置为既不填充也不描边文本".
In my case the text rendering mode was set to "Neither fill nor stroke text".
pdfbox代码:
getGraphicsState().getTextState().getRenderingMode() == PDTextState.RENDERING_MODE_NEITHER_FILL_NOR_STROKE_TEXT
这篇关于检测是否使用OCR从扫描的文档创建了PDF [pdfbox]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文