Pymupdf getTextbox returns empty

I have tried to retrieve text in a rectangle. This rectangle is retrieved from Page.getLinks(). when I try to get the text in the rectangle using getTextbox() and getText(“text”, clip=rect). Both methods return Empty string


Solution 1:

Try expanding your rectangle's coordinates slightly. The default get_textbox parameter excludes anything intercepting the bounds of the rectangle.

I was having the exact same issue and this solved it.