如何使用 iTextsharp 突出显示 pdf 文件中的文本或单词? [英] how to highlight a text or word in a pdf file using iTextsharp?

查看:30
本文介绍了如何使用 iTextsharp 突出显示 pdf 文件中的文本或单词?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在现有的 pdf 文件中搜索一个词,我想突出显示文本或词

I need to search a word in a existing pdf file and i want to highlight the text or word

并保存pdf文件

我有一个想法,使用 PdfAnnotation.CreateMarkup 我们可以找到文本的位置,我们可以向它添加 bgcolor...但我不知道如何实现它:(

I have an idea using PdfAnnotation.CreateMarkup we could find the position of the text and we can add bgcolor to it...but i dont know how to implement it :(

请帮帮我

推荐答案

这是听起来简单但实际上非常复杂"的事情之一.请参阅 Mark 的帖子此处这里.最终你可能会被指向 LocationTextExtractionStrategy.祝你好运!如果你真的知道怎么做,把它贴在这里,有几个人想知道你到底在想什么!

This is one of those "sounds easy but is actually really complicated" things. See Mark's posts here and here. Ultimately you'll probably be pointed to LocationTextExtractionStrategy. Good luck! If you actually find out how to do it post it here, there several people wondering exactly what you are wondering!

这篇关于如何使用 iTextsharp 突出显示 pdf 文件中的文本或单词?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆