Setting settings.debug.visualize_cells=True/False causes different table output
Author: kuopchingCreated Apr 3, 2025Updated Sep 14, 2026
Labelsbug
Bug
I have pre-ocr pdf with following layout.
Logo Page Header
Key-value Items Figure
Section Header1
Table1
Section Header2
Table2
- settings.debug.visualize_cells=False, only Table2 is detected.
- settings.debug.visualize_cells=True, Table1 and Table2 are detected and merged to one table. Both outcomes are wrong .
Second case can be solved by modifying file docling/models/page_preprocessing_model.py before:
if settings.debug.visualize_cells:
draw_text_boxes(page.get_image(scale=1.0), page.cells)
after:
if settings.debug.visualize_cells:
draw_text_boxes(page.get_image(scale=1.0).copy(), page.cells)
...
Steps to reproduce
Play with settings.debug.visualize_cells ...
Docling version
Docling version: 2.28.4 Docling Core version: 2.25.0 Docling IBM Models version: 3.4.1 Docling Parse version: 4.0.0 Python: cpython-310 (3.10.15) Platform: Linux-5.15.167.4-microsoft-standard-WSL2-x86_64-with-glibc2.35 ...
Python version
Python 3.10.15 ...
Source: docling-project/docling