Right-to-Left (RTL) PDF Extraction

Extract Arabic, Persian & Urdu (RTL) PDF Tables to Clean CSV & Excel

Quick summary: TableCSV extracts tables from digital and scanned Arabic (ar), Persian (fa), and Urdu (ur) PDFs with pre-baked RapidOCR models, python-bidi logical RTL ordering, right-to-left table previews, and default Excel UTF-8 BOM so text never reverses or garbles in Excel.

Built for right-to-left (RTL) Arabic, Persian & Urdu tables

Most online PDF converters and Python libraries (Camelot, Tabula-py, pdfplumber) either cannot OCR scanned Arabic PDFs or output reversed Arabic characters and mojibake in Microsoft Excel. TableCSV solves all three RTL failure points out of the box:

  • Logical bidirectional ordering (python-bidi): Restores natural Arabic, Persian, and Urdu word and numeral order inside every cell and renders the web preview table right-to-left (dir="rtl").
  • Pre-baked Arabic-script RapidOCR models: Works on crooked office scans, stamped hybrid PDFs, and photos with zero runtime model downloads.
  • Excel UTF-8 BOM + CWE-1236 formula guard: Double-clicking downloaded CSVs in Microsoft Excel opens clean Arabic/Persian/Urdu text without manual Data Import wizards, while keeping negative numbers and currency cells safe.
  • Unicode-safe multi-page header merging: Fuzzy-matches repeated Arabic column headers across pages so multi-page RTL statements merge into one clean CSV.

Pre-baked RTL languages & direct launch links

LanguageCodeRTL OrderingTry Live
Arabic (العربية)arpython-bidi + dir='rtl'Open /ar/ or ?lang=ar
Persian / Farsi (فارسی)fapython-bidi + dir='rtl'Open ?lang=fa
Urdu (اردو)urpython-bidi + dir='rtl'Open ?lang=ur

Run Arabic / RTL PDF table extraction 100% offline in Python

# Install with RTL bidirectional text support (python-bidi)
pip install "pdf-to-csv-table-extractor[rtl]"

# Extract an Arabic scanned PDF with auto-deskew & Excel UTF-8 BOM
pdf2csv-tables extract arabic_statement.pdf --lang ar --utf8-bom -o output/

# Persian (fa) or Urdu (ur)
pdf2csv-tables extract persian_report.pdf --lang fa --utf8-bom -o output/

Frequently asked questions

Why do most PDF-to-CSV tools reverse Arabic or Persian text?

PDF files store right-to-left glyphs in visual left-to-right drawing order, and many basic OCR or PDF extractors concatenate glyphs without applying the Unicode Bidirectional Algorithm. TableCSV ships with python-bidi pre-installed so Arabic (ar), Persian (fa), and Urdu (ur) cells are converted back to proper logical reading order and previewed right-to-left (dir='rtl').

Why do Arabic CSVs show garbled symbols when opened in Microsoft Excel?

Microsoft Excel opens UTF-8 CSV files with a legacy Windows code page unless a UTF-8 Byte Order Mark (BOM) is present at the start of the file. TableCSV enables Excel UTF-8 BOM by default so Arabic, Persian, and Urdu spreadsheets display crisp Arabic script immediately on double-click.

Does TableCSV work on scanned Arabic invoices, bank statements, and government forms?

Yes. TableCSV pre-bakes the RapidOCR Arabic script recognition model directly into the server container, combines it with automatic deskewing for crooked scans and OpenCV bordered/borderless table detection, and processes files strictly in RAM with zero file retention.

How do I extract Arabic or Persian PDF tables offline in Python?

Install the optional RTL extra via `pip install 'pdf-to-csv-table-extractor[rtl]'` (which installs python-bidi), then run `pdf2csv-tables extract invoice.pdf --lang ar --utf8-bom -o output/`. Works 100% offline on Linux, macOS, Windows, and Docker.