Skip to main content

Bilingual Invoice (Arabic + English)

An export invoice in English and Arabic, issued by a Verdania trading firm to an engineering consultancy in Riyadh. Each language reads in its own direction, side by side on the same page.

  • A mirrored header band. The seller's name, address, registration and VAT numbers in English on the left, and in Arabic on the right under فاتورة.
  • Bilingual key facts. Invoice number, issue date, due date and purchase order, each under a label in both languages.
  • Parallel blocks. The bill-to block, the totals and the payment panel put English on the left and Arabic on the right, each reading in its native direction through direction: "rtl" on the Arabic styles.
  • Line items from data. The table is read with source, the English and Arabic descriptions side by side in one row, under bilingual headers.
  • Two totals tables that audit each other. Subtotal, VAT at 15%, shipping and the total due in English, and the same figures in Arabic-Indic digits.
  • Wire-transfer details and an electronic seal. Beneficiary, bank, IBAN, SWIFT and reference in both languages, beside the seller's seal, a shared component placed with use.
  • Plus a warranty and arbitration note in both languages. Arabic renders with no font registration: the vendored Arabic face is applied when the script is detected.

Features used: PDF/A-2b conformance, columns, tables, SVG, data binding, components, Arabic text

How it's built​

Two columns, two directions​

Each bilingual block is a columns node with two equal columns, English in the first and Arabic in the second. Every English style has an Arabic twin that adds direction: "rtl" and textAlign: "right": body and bodyAr, muted and mutedAr, th and thAr, and so on.

"styles": {
"body": { "fontSize": 11, "color": "#0F2A44", "marginBottom": 3, "fontWeight": "bold" },
"bodyAr": { "fontSize": 11, "color": "#0F2A44", "direction": "rtl", "textAlign": "right", "marginBottom": 3, "fontWeight": "bold" }
}

The data file gives a second value wherever the two languages differ: nameAr, addressAr, issuedAr, and the totals in Arabic-Indic digits, such as grandTotalAr. A value that reads the same in both, like the VAT number, the IBAN or the SWIFT code, is given once and placed in both columns. The only face the document declares is OCRB, for the seal's document number; the Arabic needs none.

Line items from the data​

The items table names its array with source. The first row is the header, its cells stacking the English label over the Arabic one with [br]; the second is the row repeated for each entry, where $item is the entry:

{
"table": {
"style": "items",
"source": "$data.items",
"widths": [6, 6, 2, 3, 3],
"rows": [
[
{ "th": "Description", "style": "th" },
{ "th": "الوصف", "style": "thAr" },
{ "th": "Qty[br]الكمية", "style": "thRight" },
{ "th": "Unit price[br]سعر الوحدة", "style": "thRight" },
{ "th": "Line total[br]الإجمالي", "style": "thRight" }
],
[
{ "td": "$item.description", "style": "td" },
{ "td": "$item.descriptionAr", "style": "tdAr" },
{ "td": "$item.qty", "style": "tdRight" },
{ "td": "$data.invoice.currency $item.unit", "style": "tdRight" },
{ "td": "$data.invoice.currency $item.total", "style": "tdRight" }
]
]
}
}

The seal​

The seal is the shared digital-eseal component, placed with use inside an svg. Its three parameters are the organisation's name, a caption and the document id, here bound to the invoice number:

{
"svg": {
"width": 82,
"height": 82,
"viewBox": [150, 150],
"title": "Electronic seal of $data.seller.name",
"children": [
{
"use": {
"name": "digital-eseal",
"x": 0,
"y": 0,
"width": 150,
"height": 150,
"params": { "title": "APEX TRADING FZ-LLC", "caption": "ELECTRONICALLY SEALED", "docid": "$data.invoice.number" }
}
}
]
}
}

The component draws the visible mark only; this invoice carries no digital signature.