Answer the question
In order to leave comments, you need to log in
How to get the highlight color of a character in a document using python?
In a pdf document, you need to know the highlight color of each character. Where to dig to solve this problem? Pdfminer is not suitable (I read that it is not about colors). PyPDF, python-docx (converted pdf to docx, with formatting preserved) - I can't find the necessary functionality there.
Answer the question
In order to leave comments, you need to log in
Found something (only for .docx):
import docx
doc = docx.Document('1.docx')
for p in doc.paragraphs:
for r in p.runs:
print(r.font.highlight_color, r.text)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question