Highlight text in a PDF with Python [closed]

倖福魔咒の 提交于 2019-12-09 04:53:18

问题


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?


回答1:


You can highlight text using PyPDF2.

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



来源:https://stackoverflow.com/questions/40288400/highlight-text-in-a-pdf-with-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!