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

查看:104
本文介绍了如何使用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的帖子这里此处最终你可能会被指向 LocationTextExtra ctionStrategy 。祝好运!如果你真的知道如何在这里发布它,有几个人想知道你在想什么!

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天全站免登陆