3

I am currently trying to use PyPDF2 to read the PDF file in the Python.I want to know whether the text of the PDF file is highlighted or not.

Context:

We use to highlight text in PDF file with a different color.Is there any way to know which text is highlighted in Python using any library or so? If there is please direct me to the right source.

I look into many places for this problem.What I found is PyPDF2 can't solve this problem?

Abdul
  • 2,002
  • 7
  • 31
  • 65
ankyAS
  • 301
  • 2
  • 11

1 Answers1

0

In PyPdf2, you can use get a pageObject which is a dictionary. You can then search for key = '/Annots' and its values in it. You can at least know whether page is having highlighted text or not.

K246
  • 1,077
  • 1
  • 8
  • 14