Skip to content

Commit

Permalink
speedup table extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
fedor-chervinskii authored and JorjMcKie committed Dec 3, 2023
1 parent bba1177 commit 5a000bc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fitz/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,11 @@ def get_text(cell):
cell = Rect(cell) # we need a Rect object
text = "" # result text
for block in TEXTPAGE.extractRAWDICT()["blocks"]:
if Rect(block["bbox"]).intersect(cell).is_empty:
continue
for line in block["lines"]:
if Rect(line["bbox"]).intersect(cell).is_empty:
continue
for span in line["spans"]:
chars = span["chars"]
if text and chars:
Expand Down

0 comments on commit 5a000bc

Please sign in to comment.