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?
If you want to highlight text from multiple PDF files, you can either specify the folder to the -i parameter or merge the pdf files together and run the code to come up with a single PDF that has all the text you want to be highlighted.
Open your PDF in Acrobat. Click and drag the cursor to select the area of text you want to highlight. A small toolbox will appear above your text. Select the highlighter tool icon and it will automatically highlight your selected text.
You can highlight text using PyPDF2.
In order to find the text's location, check out this answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With