Arabic & RTL Support

Generate all 5 document types in Arabic with full right-to-left layout. Arabic labels, bilingual support, and 12+ Arabic currencies. The RTL layout also works for Hebrew and Persian text, but automatic label translation is Arabic only. Just add one field to any request.

How to Enable RTL

Add direction: "rtl" to any endpoint request. That's it — the entire PDF layout flips automatically.

json
{
"direction": "rtl",
...rest of your normal request
}

Works with all 5 endpoints: Invoice | Receipt | Quote | Credit Note | Packing Slip

What Changes in RTL Mode

FeatureLTR (Default)RTL
Text directionLeft to rightRight to left
LayoutCompany info left, title rightCompany info right, title left
Table columnsDescription first, Amount lastAmount first, Description last
Totals positionRight-alignedLeft-aligned
LabelsEnglishArabic
FontDM SansNoto Sans Arabic
NumbersLeft to rightLeft to right (stays the same)

Arabic Labels

When direction: "rtl", all document labels automatically switch to Arabic:

EnglishArabic
Invoiceفاتورة
Receiptإيصال
Quoteعرض سعر
Credit Noteإشعار دائن
Packing Slipقائمة التعبئة
Bill Toفاتورة إلى
Dateالتاريخ
Due Dateتاريخ الاستحقاق
Descriptionالوصف
Quantityالكمية
Unit Priceسعر الوحدة
Amountالمبلغ
Subtotalالمجموع الفرعي
Taxالضريبة
Totalالإجمالي
Notesملاحظات
PAIDمدفوع

Supported Currencies

All standard currencies work, plus these Arabic currencies are fully supported:

CurrencyCodeSymbol
Saudi RiyalSAR
UAE DirhamAEDد.إ
Egyptian PoundEGPج.م
Qatari RiyalQARر.ق
Kuwaiti DinarKWDد.ك
Bahraini DinarBHDد.ب
Omani RialOMRر.ع
Jordanian DinarJODد.أ
Iraqi DinarIQDع.د
Lebanese PoundLBPل.ل
Moroccan DirhamMADد.م
Tunisian DinarTNDد.ت

Full Arabic Invoice Example

bash
curl -X POST https://api.kagyz.com/v1/invoice \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"invoice_number": "INV-001",
"issue_date": "2026-03-15",
"due_date": "2026-04-15",
"currency": "SAR",
"direction": "rtl",
"from": {
"name": "شركة أكمي للتقنية",
"email": "billing@acme-tech.sa",
"address": "شارع الملك فهد\nالرياض 12345"
},
"to": {
"name": "شركة التقدم للحلول",
"email": "accounts@taqadum.sa"
},
"items": [
{ "description": "تصميم وتطوير الموقع الإلكتروني", "quantity": 1, "unit_price": 15000 },
{ "description": "صيانة شهرية ودعم فني", "quantity": 6, "unit_price": 2000 }
],
"tax": { "rate": 15 },
"notes": "يرجى السداد خلال 30 يوماً من تاريخ الفاتورة."
}' \
--output invoice-arabic.pdf
javascript
const response = await fetch('https://api.kagyz.com/v1/invoice', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
invoice_number: 'INV-001',
issue_date: '2026-03-15',
due_date: '2026-04-15',
currency: 'SAR',
direction: 'rtl',
from: { name: 'شركة أكمي للتقنية', email: 'billing@acme-tech.sa' },
to: { name: 'شركة التقدم للحلول' },
items: [
{ description: 'تصميم وتطوير الموقع الإلكتروني', quantity: 1, unit_price: 15000 },
{ description: 'صيانة شهرية ودعم فني', quantity: 6, unit_price: 2000 }
],
tax: { rate: 15 },
notes: 'يرجى السداد خلال 30 يوماً.'
})
});

Bilingual Documents

You can mix Arabic and English text in any document regardless of direction. The renderer handles bidirectional text automatically:

json
{
"direction": "ltr",
"from": {
"name": "شركة الخليج للتجارة — Gulf Trading Co."
},
"items": [
{ "description": "Consulting Services — خدمات استشارية", "quantity": 1, "unit_price": 5000 }
]
}

Arabic text will render correctly within LTR documents, and English text will render correctly within RTL documents.

Language Field (Optional)

You can optionally pass a language field for metadata purposes:

json
{
"direction": "rtl",
"language": "ar"
}

Supported values include: ar (Arabic), he (Hebrew), fa (Persian/Farsi), ur (Urdu). This field is optional and doesn't change rendering — use direction to control layout. Note: automatic Arabic labels only apply when direction: "rtl" is set. Hebrew, Persian, and Urdu text will render correctly in RTL mode, but labels will be in Arabic (not translated to those languages).

RTL works with all endpoints: Invoice | Receipt | Quote | Credit Note | Packing Slip