'Use PyMuPDF to bold parts of text

I am trying to use PyMuPDF to bold portions of each word in a PDF file.

So, for example, a file with the string "There are many pies" will result in "There are many pies"

I have seen that you can use Page.get_textpage().extractWORDS() to sort of extract a tuple of the various words. However, I'm not sure exactly how to bold portions of them.

I had thought maybe you could erase them and then re-write them, but I'm not sure if PyMuPDF can erase words.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source