diff --git a/pymupdf4llm/pymupdf4llm/helpers/pymupdf_rag.py b/pymupdf4llm/pymupdf4llm/helpers/pymupdf_rag.py index d0f2e9aa..3dc81b00 100644 --- a/pymupdf4llm/pymupdf4llm/helpers/pymupdf_rag.py +++ b/pymupdf4llm/pymupdf4llm/helpers/pymupdf_rag.py @@ -1030,11 +1030,14 @@ def get_page_output( else: tabs = page.find_tables(clip=parms.clip, strategy=table_strategy) for t in tabs.tables: - # 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)) - continue - parms.tabs.append(t) + try: + # 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)) + continue + parms.tabs.append(t) + except: + pass parms.tabs.sort(key=lambda t: (t.bbox[0], t.bbox[1])) # Make a list of table boundary boxes.