change text color or highlight text with multiple colors using python - python-3.x

I am trying to read the pdf and highlight some sub-strings in pdf, and i am able to achieve it using python libraries PYPDF2 and fitz
but i wanted to make to highlight/ change text with different colors and retain the layout of the original pdf,
please advice on this, thank you

We can't change the textcolor of words inside the pdf but we can use the
highlight annot
with default color("yellow"),
if need more colors we need to make the
square annot
using pymupdf lib, this worked for me in python

Related

get colored text in pdf file

I have a pdf include some MCQ questions and the right answer is colored and underlined
so I want to extract all the answer from the pdf and put them in the last page
I use pyPDF2 to transport the text from the pdf to a text.txt file
now I want to know how to get words in color or underlined from pdf with python
then I can put them in a list and to what I want
so, what can I use in order to do that ?

extract specific text from image by using easyocr

I use easy OCR to extract text from images, and it works well for me. However, I need to remove shaded numbers from the extracted text result. I need to erase text if it's shaded.
Any help?? For example in the following picture, I need to delete "2586" and extract only "2574"

What's the simplest way of changing the color of single characters?

I'm using openpyxl to write some data to an Excel file. I'm able to change the text color of whole cells using the Font class, but what about changing the color of single characters from a string?

how to color the pandas table and export it into html

I am using python spyder, Python v. 3, I need to color format the pandas DataFrame table and export it into HTML or image file, in case if export to image, how to make the image height and width of the table and set appropriate font size.
Could someone please help me on this.
What may be of help is Styler available in pandas. Have a look at the tutorial. Without MCVE it is difficult to answer more precisely.
The HTML output is covered by this question: Python Pandas Data Frame save as HTML page

How to do you make colored bullet points with python-docx?

I am wondering if it is possible to set the bullet point color in python-docx (style= List Bullet) without changing the font color?
I know its possible using word but I can't find the attribute to do this via code.
Thanks

Resources