当前位置:   article > 正文

python修改pdf文字,使用Python突出显示PDF中的文本

python pypdf2 替换文字

I'm working on custom search engine for my PDF data corpus.

I have a transformation layer which is able to dump PDF content to text (using Apache Tika and GROBID). I have finished search layers and the view which return search results listing.

Now, I'd like to add highlighting feature on original PDF for the lines, where search terms was appeared. Yes, I wanna modifiy PDF files if it is necessary.

Is there any way for highlight text inside in PDF file? Are PDFMiner or PyPDF2 or other Python library is able to do that?

... or can you recommand other, maybe external service for it?

解决方案

You can highlight text using PyPDF2.

In order to find the text's location, check out this answer.

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小小林熬夜学编程/article/detail/319553
推荐阅读
相关标签
  

闽ICP备14008679号