I'm searching for text in a pdf and extracting a quad and adding a polygon_annot around it. But I would like to scale the polygon_annot. How can I do that?
Below is my code:
for inst in text_instances:
inst = inst.transform(fitz.Matrix(2, 2))
print(inst)
print(inst.rect)
# re-ordering the points in list counter-clockwise
inst[2], inst[3] = inst[3], inst[2]
highlight = page.add_polygon_annot(inst)
i'm currently scaling it with inst.transform(fitz.Matrix(2, 2)), but this is to simply multiply the values. How do I scale the values frfom the center of the quad?