Fix: Add missing bbox attribute to PdfTextCell

This commit is contained in:
hl2311 2025-03-22 02:37:46 +07:00
parent 7df157204b
commit c030211fdc

View File

@ -63,7 +63,7 @@ class PagePreprocessingModel(BasePageModel):
def draw_text_boxes(image, cells, show: bool = False): def draw_text_boxes(image, cells, show: bool = False):
draw = ImageDraw.Draw(image) draw = ImageDraw.Draw(image)
for c in cells: for c in cells:
x0, y0, x1, y1 = c.bbox.as_tuple() x0, y0, x1, y1 = c.to_bounding_box().l, c.to_bounding_box().t, c.to_bounding_box().r, c.to_bounding_box().b
draw.rectangle([(x0, y0), (x1, y1)], outline="red") draw.rectangle([(x0, y0), (x1, y1)], outline="red")
if show: if show:
image.show() image.show()