bug: PDF: table cell text joins and splits words while page text keeps the correct spacing
Description
On page 85 of this public PDF, Xberg 1.3.0 extracts corrispettivi superiori al costo as corrispettivisuperiori alcosto and d’impresa as d’im presa inside table cells. Both phrases have the correct spacing in the extracted page text.
Reproduces with OCR disabled. The result reports native extraction.
The problem appears to be in table-cell text assembly. extract_cell_text reconstructs text from spans and cell_span_separator decides spacing from their geometric gaps. I haven’t confirmed which span boundaries cause these two failures.
Steps to reproduce
- Download the PDF linked above as
circular-1-2026.pdf. - Extract it with the Xberg 1.3.0 CLI:
xberg extract circular-1-2026.pdf \
--no-config-discovery \
--config-json '{"disable_ocr":true,"use_cache":false,"enable_quality_processing":false,"pages":{"extract_pages":true},"pdf_options":{"extract_tables":true,"ocr_inline_images":false},"include_document_structure":true}' \
--format json > result.json- Compare the cells in
result.tableswithpage_number: 85againstresult.pages[84].content.
The table cells should preserve the same word boundaries as the page text.
Relevant files and configuration
Tested with the released macOS arm64 CLI, reporting xberg 1.3.0. OCR, caching, and quality processing were disabled; table extraction and document structure were enabled.
Original PDF SHA-256:
75436a448f828d68fc076310373b3753f189a32d51de73c4ffe1092597eb3f84Source: xberg-io/xberg