【发布时间】:2021-10-03 21:06:23
【问题描述】:
我正在搜索 pdf 中的文本并提取一个四边形并在其周围添加一个 polygon_annot。 但我想缩放polygon_annot。我该怎么做?
下面是我的代码:
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)
我目前正在使用 inst.transform(fitz.Matrix(2, 2)) 对其进行缩放,但这只是将值相乘。如何从四边形的中心缩放值?
【问题讨论】: