My client copied Arabic text out of the quote PDF and it came out jumbled; why?

Because a PDF stores the shapes of the letters as they are drawn on the page, not the words as they are typed, and some programs read Arabic back in visual order when copying, so it comes out reversed or broken apart. The file itself is fine and looks correct on screen and on paper. If the client needs the text to reuse, send them the lines as plain text along with the file.

Published · 3 min read

What is actually going on

Arabic letters join and change shape depending on their position in a word, and they run right to left. To draw a correct Arabic line, the quotation generator shapes the letters and places them on the page in their visual order. That is what your eyes see, and it is right. When a program tries to get the text back out of the file, it relies on an internal table mapping each shape to its letter, and some programs read that table in visual order, so a word comes out backwards, or the lam-alef ligature splits into two letters the wrong way round.

This is not specific to our tool: the PDF text extractor on the same site warns about exactly this, noting that extracted Arabic varies from file to file and program to program.

Does it affect the quote itself?

  • No, reading on screen is correct in the usual PDF viewers.
  • No, printing is correct.
  • Figures and amounts are drawn in Western digits and each number stays intact.
  • Only copy and paste, and searching inside the file, are affected, and only in some programs.

When the client needs the text

The usual case: someone in the client's purchasing team wants to copy the line descriptions into their system to raise a purchase order. Rather than making them retype everything, help them in one of these ways:

  1. Keep the lines in a text note as you prepare the quote, then paste them into the body of the message or email that carries the file.
  2. If the client works in English anyway, create an English version with the document language set to English and English descriptions; you do not need to re-enter anything while the page is open.
  3. Say in your message that the file is for viewing and printing, and the pasted text is for copying.

Nearby problems that are different

  • A ‘?’ in place of a character: that is a character the font does not cover, such as an emoji, not a copying issue. The tool tells you how many when it builds the file.
  • Diacritics sitting slightly off: a known limit in how diacritics are drawn, which is why it is better to leave them out of descriptions.
  • A Latin word in the middle of an Arabic line: the Quotation generator keeps Latin phrases such as product names readable left to right inside the line.

Common questions

Can the file be fixed after it is created?

No tool can reliably repair the Arabic text layer of a PDF. Sending the text separately is the easy route.

Is it different on a phone and a computer?

The result depends on the program doing the copying, so it may work in one and fail in another.

Does this stop searching inside the file?

Searching for an Arabic word may fail in some programs for the same reason; numbers are easier to search for.