← ClaudeAtlas

arabic-pdflisted

Generate PDF documents containing Arabic (or any right-to-left script — Persian, Urdu, Hebrew) using reportlab, with correct glyph shaping, bidirectional ordering, line wrapping, and RTL tables. Use this skill whenever the user asks for a PDF, report, summary, proposal, thesis chapter, invoice, certificate, or any printable document whose content is in Arabic or mixes Arabic with Latin technical terms — even if they don't mention "RTL" or name a library. Also use it when an existing Arabic PDF comes out with reversed lines, shuffled words, disconnected letters, or black boxes instead of glyphs.
asadeisa/arabic-office-skills · ★ 2 · Data & Documents · score 63
Install: claude install-skill asadeisa/arabic-office-skills
# Arabic / RTL PDF generation Naive reportlab code produces Arabic that is subtly and thoroughly wrong: letters appear disconnected, words within a line run backwards, and lines within a paragraph swap places. None of this is visible in extracted text — only in a render. This skill bundles a builder that has these problems already solved. **Use `scripts/arabic_pdf.py` rather than writing reshaping logic from scratch.** Every failure mode below was found by hitting it in a real document. ## Dependencies ```bash pip install reportlab arabic-reshaper python-bidi pypdfium2 ``` `pypdfium2` is only for previewing, but previewing is not optional — see Verification below. ## Building a document Import the builder either by copying `scripts/arabic_pdf.py` next to your generation script, or by adding this skill's `scripts/` folder to `sys.path`: ```python import pathlib, sys sys.path.insert(0, str(pathlib.Path.home() / ".claude" / "skills" / "arabic-pdf" / "scripts")) from arabic_pdf import ArabicPDF, preview pdf = ArabicPDF("report.pdf", doc_title="عنوان المستند", page_numbers=True) pdf.title("عنوان المستند") pdf.subtitle("سطر فرعي") pdf.heading("أولاً — المقدمة") pdf.para("فقرة عربية تتضمن مصطلحات لاتينية مثل PostgreSQL و FastAPI.") pdf.heading("ثانياً — جدول") pdf.table( ["البند", "التفصيل"], # rightmost column first [["الواجهة الخلفية", "Python — FastAPI"], ["قاعدة البيانات", "PostgreSQL — SQLAlchemy"]], [5.0, 11.0],