开发者

iText Search, Highlight, image of result

开发者 https://www.devze.com 2023-01-31 04:23 出处:网络
I want to Do these tasks: 1-find a word in pdf 2-highlight all occurrences in that pdf, 3-save highlighted pdf as ima开发者_如何学Cges of its pages.

I want to Do these tasks: 1-find a word in pdf 2-highlight all occurrences in that pdf, 3-save highlighted pdf as ima开发者_如何学Cges of its pages.

How can I do this ? Any help will be appreciated.


com.itextpdf.text.pdf.parser.LocationTextExtractionStrategy

It'll give you the baseline, ascent, and descent of every piece of text on the page. It's up to you to build words and rectangles from that information.

Not Easy, but possible.

After that, you just need to call GhostScript or PDFBox or something that can render PDFs. Hardly "the easy part", but it's a solved problem many times over.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号