#2560·markitdown

PDF bottom-to-top table headers are reversed in agstat.pdf (0.1.8)

Author: zhangweiooyCreated Sep 28, 2026Updated Sep 28, 2026

What happened

MarkItDown 0.1.8 extracts bottom-to-top rotated table headers in the wrong character order from a public PDF. It also merges some adjacent numeric cells in the same table.

Reproduction

Public sample: agstat.pdf (the same file discussed in jsvine/pdfplumber#942).

python
from markitdown import MarkItDown
text = MarkItDown().convert("agstat.pdf").text_content
print(text)

With markitdown==0.1.8, pdfplumber==0.11.10, Python 3.12 on Windows, the output contains noitalupoP detcejorP and firahK instead of Projected Population and Kharif. In the Balasore row, the output also joins neighboring values, for example 3.47 2.78 in one cell and 0.86 3.64 in another.

The same PDF produces these reversed words with pdfplumber's default page.extract_words(). For this sample, page.extract_words(char_dir_rotated="btt") returns Projected Population and Kharif correctly. That alone does not establish that the multi-line headers and table columns are fully reconstructed.

Expected behavior

The rendered bottom-to-top headers should be readable and their values should remain in the correct table columns. At minimum, the converter should offer a way to configure rotated text direction for PDFs that need it. A global btt setting would likely be wrong for other PDFs.

Related upstream issue

jsvine/pdfplumber#942 tracks this exact PDF and the remaining multi-line vertical-header layout problem. I am reporting this here because MarkItDown's PDF converter calls extract_words() without a rotated-direction option and its public conversion path does not expose one. The problem still reproduces in the latest stable MarkItDown release, 0.1.8.