My need is to get an image of the text in a word file using Python. The text length changes with every file. How can I detect the text and take a screenshot or generate an image of that text without including the whitespace from the rest of the document? The text can span multiple lines.
Here is an example of the word file
And this is the result I am looking for
I'm writing a script that reads the word file, takes a screenshot as above, and then saves it to a location.
EDIT: SOLVED.