Skip to main content
GullySystem
A practical guide

Why Arabic and Hebrew documents print the wrong way round

Ganesh HSStrategy and Technology, GullySystem
Practical advice · 4 min read

In this guide 7 sections
The short answer

Right-to-left text breaks when the PDF engine lays out characters one by one instead of applying the bidirectional algorithm, or when the font lacks joining shapes. Mixed content such as numbers, product codes and brand names then lands in the wrong order. Test with a printed invoice, not a screen.

Where the reversal comes from

Arabic and Hebrew run right to left. Numbers, Latin brand names and product codes run left to right inside the same sentence. The Unicode bidirectional algorithm decides the final order. PDF libraries differ here, and some never run it.

When the engine skips that step, it draws each character in storage order. You see Arabic letters reversed, or Hebrew words in the right order but the sentence flipped.

Arabic adds a second fault. Each letter changes shape depending on where it sits in a word. A basic engine prints the isolated forms, so the word looks like a row of loose letters.

  • Engine ignores the bidirectional algorithm
  • Font lacks initial, medial and final forms
  • Text stored in visual order, not logical order
  • Template fixed to a left-aligned layout

Tables, totals and mirrored layouts

A right-to-left page should mirror its layout. The item column moves to the right, the total column to the left, and the logo and address block swap sides. A template built for English only flips the words and leaves the grid behind.

Check column order on the invoice. Description, quantity, rate and amount should run in the direction the customer reads. Header text aligned left over right-aligned content looks careless to a buyer in Riyadh or Tel Aviv.

Page numbers, bullet marks and parentheses flip as well. Look for a closing bracket sitting on the wrong end of a line.

Numbers, codes and brand names inside sentences

The classic bug is an Arabic sentence ending in an order number. The number jumps to the start, or its digits reverse. A product code like AB-2041/7 comes out as 7/2041-AB.

Mixed content needs direction marks or isolate controls around the Latin run. The template author has to add them, or the engine has to detect them correctly. Neither happens by accident.

Decide which digits you print. Arabic-Indic digits and Western digits are each used in different markets. Ask the customer, then keep one rule per country.

  • Order numbers and invoice references
  • SKU and part codes with hyphens and slashes
  • Brand names in Latin script
  • Dates, decimal marks and currency signs
  • Email addresses and web links

Fonts and PDF engines

Pick a font with full Arabic or Hebrew coverage and embed it in the file. If the font is only referenced, the customer’s viewer swaps in another, and shapes or spacing change.

Some engines, such as headless browsers, shape text correctly. Older libraries that draw glyphs from coordinates do not. Ask the developer which one produces your PDFs and whether it applies shaping and bidirectional ordering.

Watch line breaks. A narrow cell can split a word at the wrong place, and the wrapped line can continue on the wrong side.

Test on paper with a native reader

A screen preview hides faults that appear in print: clipped digits, shifted columns, missing glyphs. Print an invoice, a delivery note and a customer statement. Use real data with long names, a part code and a foreign brand.

Ask a native reader to mark every line that looks wrong. Your own eye will miss things. Keep the marked copy and attach it to the bug report.

Then add three sample documents to your release checks, so every template change gets printed again.

Put the advice to work.

Use a test copy or fictional example to turn the discussion into something your team can check.

Where the reversal comes from

Which observation would change the proposed scope?

For “Where the reversal comes from”, observe someone completing the task with a representative example. Record where they stop, ask another person or re-enter information, then choose the smallest change whose result the team can verify.

Background reading: GOV.UK: researching user needs

Right-to-left print test sheet

A single printed checklist of ten rows. Each row names an element, such as page mirroring, column order, order number, SKU with slashes, brand name, date, currency sign, embedded font, line wrap and page number. Columns hold pass or fail, the printed sample and the reader’s note.

Open a blank worksheet to print

Questions owners ask

Why do Arabic letters appear disconnected in my PDF?

The engine is printing isolated letter forms. It needs text shaping, plus a font that includes the joining shapes.

Why does my order number jump to the other end of the line?

Numbers are left-to-right text inside a right-to-left sentence. Without correct direction marks, the engine places the run in the wrong spot.

Do I need a separate template for Hebrew and Arabic?

One mirrored right-to-left template can serve both, with the font and digit style set per language. Test each one on paper.

Is a screen preview enough to approve a template?

No. Print it. Clipped digits and shifted columns show only on paper, and a native reader should review the result.

Browse all guidesBack to top ↑
Next step

Have a specific situation to work through?

This article covers the general case. Tell us what you’re actually dealing with and we’ll respond directly.

Share Your Requirements