diff --git a/pymupdf4llm/pymupdf4llm/helpers/pymupdf_rag.py b/pymupdf4llm/pymupdf4llm/helpers/pymupdf_rag.py index 6b860800..c3d6f2bd 100644 --- a/pymupdf4llm/pymupdf4llm/helpers/pymupdf_rag.py +++ b/pymupdf4llm/pymupdf4llm/helpers/pymupdf_rag.py @@ -1052,6 +1052,10 @@ def get_page_output( else: tabs = page.find_tables(clip=parms.clip, strategy=table_strategy) for t in tabs.tables: + # Skip tables with no valid cells (would cause bbox calculation to fail) + if not any(c is not None for c in t.cells): + continue + # remove tables with too few rows or columns if t.row_count < 2 or t.col_count < 2: omitted_table_rects.append(pymupdf.Rect(t.bbox))