# Arabic PDF Generation (RTL reportlab)

> Arabic and RTL PDFs with joined letters, correct word order, proper line wrapping and right-to-left tables, using reportlab.

Arabic PDF Generation (RTL reportlab) is a free AI agent skill on Agensi by asad eisa. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [asad eisa](https://www.agensi.io/creators/asad-eisa)
- Uses: 2
- Version: 1.0
- Last updated: 2026-10-05
- Security: scan passed (2026-10-05); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/arabic-pdf-generation-rtl-reportlab
- Tags: arabic, rtl, pdf, reportlab, arabic-reshaper, bidi, persian, hebrew

## About this skill

reportlab has no text engine, so an AI agent's first Arabic PDF almost always comes out wrong: letters stand apart instead of joining, each line reads back to front, multi-line paragraphs swap their lines, and English names like `iPhone 15` jump out of the sentence. The text extracts fine, so the agent thinks it worked.

This skill gives your agent a tested builder that shapes, reorders and wraps Arabic correctly, line by line.

**What it handles**

- **Shaping and bidi:** letters join, words read right to left, mixed English terms and numbers stay in place.
- **Line wrapping done right:** text is wrapped first and reordered per line, so long paragraphs keep their line order.
- **Brackets and mixed text:** brackets and numbers never end up on the wrong side.
- **RTL tables:** columns given in reading order, first column on the right.
- **Fonts:** finds an Arabic-capable font automatically, or uses yours (Amiri, Noto Naskh…).
- **Images:** `draw_text()` writes Arabic labels into Pillow images, using libraqm when available.
- **Visual check:** `preview()` renders every page to PNG so the agent can look before delivering.

Works for Arabic, Persian, Urdu and Hebrew. Free and open source (MIT).

## Requires

- Python

## Known limitations

The builder covers titles, headings, paragraphs, bullet lists, RTL tables and page numbers. It does not add images, a table of contents, bookmarks or links; for long documents with those, generate a Word file with the arabic-docx skill and export it to PDF. Because reportlab has no text engine, Arabic is stored pre-shaped in visual order: the PDF looks correct, but copying or searching Arabic text in a PDF viewer may return reversed or altered characters. An Arabic-capable TTF font is required (found automatically on most systems, or pass your own). Bullets are typed markers, not true list structures.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Arabic PDF Generation (RTL reportlab) skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### Why do I need this skill if my agent already knows how to use reportlab?

Standard reportlab lacks a text engine to handle complex scripts, resulting in disconnected letters and reversed word orders. This skill provides a specialized builder that manages shaping and bidirectional reordering so your agent can generate professional, readable Arabic PDFs.

### Does this support languages other than Arabic, such as Hebrew or Persian?

The skill handles right-to-left (RTL) scripts including Arabic, Persian (Farsi), Urdu, and Hebrew, while correctly preserving the order of mixed-in English text and numbers.

### Can this skill generate tables with a right-to-left column flow?

Yes, the skill includes a specific RTL table handler that ensures columns are rendered in reading order, starting from the right-hand side of the page.

### What are the technical requirements for my AI agent to use this?

This skill is designed for any AI agent capable of executing Python code. It includes an automated font-discovery feature and a preview function that renders pages to PNG so the agent can visually verify the layout.

### How does this tool handle long paragraphs and multi-line wrapping?

Unlike basic scripts, this builder wraps text before reordering each line. This prevents the common 'line-swap' bug where the bottom of a paragraph accidentally appears at the top.

### What exactly is included in the purchase?

You receive the full source code under the MIT license, including the core PDF builder, the Pillow-based image labeling tool, and the visual preview utility.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
