1

Suppose I run PyMuPDF's search for function:

import fitz
doc = fitz.Document(pdf_path)
page = doc[pg]
coords = page.search_for('foo', quads=True)

First off, is this guaranteed to be the exact, minimal bounding rectangle of the text matched? -- I have reason to believe it isn't, but I could be wrong.

If it is not guaranteed to be exact, the question is: how do I acquire the exact, minimal rectangle bounding just the text that is matched and not the overall group it belongs to?

Chris
  • 28,822
  • 27
  • 83
  • 158

0 Answers0