Edit & Sign

Why right-to-left text breaks in PDF

Right-to-left languages fail in PDF in a very specific way that makes the problem hard to spot: the file often looks right to the person who made it, and wrong to the person who receives it. This page explains what is happening so you can tell whether a file is safe to send.

A PDF does not know what a word is

When a PDF page is drawn, every character is placed at a coordinate. The file stores a series of "draw this glyph at this x, y" instructions. It has no concept of a word, a line, or reading direction — those are properties of text as humans use it, and they are gone by the time the page is a set of positions.

For a left-to-right language this is invisible, because the visual order of glyphs and the logical order of characters happen to be the same. For Arabic and Hebrew they are not, and that difference is where everything breaks.

The two things that can go wrong

1. Reversed order

If the text was laid out left-to-right and then the characters were placed in storage order, the result reads backwards — the first word appears on the right where the last word should be. To a reader of the language this looks like the sentence is scrambled; to someone who does not read it, it looks like ordinary text, which is why it gets sent.

2. Disconnected letters

Arabic letters change shape depending on their neighbours — a letter at the start of a word is drawn differently from the same letter in the middle. The process of choosing the correct form for each position is called shaping, and it has to happen before the glyphs are placed.

If shaping is skipped, every letter appears in its isolated form: correct individually, unreadable as a word. It is the equivalent of writing “c a t” with spaces between the letters instead of “cat”. The characters are all present and all correct. The word never appears.

Why it looks fine on your screen

Browsers and modern text engines do this work automatically: they reorder and shape as they render, invisibly, every time. So a document previewed in a browser, or typed into a web form, looks correct. The break happens when that text leaves the browser — at the step where it is converted to positioned glyphs for a PDF.

That is why the failure is consistently reported as it looked fine when I made it. It was fine, in the environment that was doing the work for you. The finished PDF is a different environment that does not.

How to check a file before sending it

You do not need to read the language to test the file. Three checks, in increasing order of confidence:

  1. Copy and paste a line into a plain text editor. Select a line of RTL text from the PDF and paste it somewhere without formatting. If the characters come out in reverse order, the file has a reordering problem. Pasted text should read in logical order, the same way it would if typed.
  2. Search for a word you can see. Type a short word from the page into the viewer's search. If the file was stored reversed, searching for the word as written will not find it — it will only find it typed backwards.
  3. Ask a reader of the language to look at one line. The two checks above catch reversed order reliably. Disconnected letters are subtler and a native reader spots them instantly — this is the check that matters most, and it takes one sentence.

Where the risk is highest

  • Text added after the original was made — annotations, stamps, edits, signatures and form values are added to an existing page, and each addition is a chance for order to be lost.
  • Text converted from another format — export paths differ, and some converters handle shaping differently from others.
  • Scanned documents with an added text layer — the visible page is an image and always looks right; the invisible text behind it may be reversed or unshaped, so search and copy fail while the page looks perfect.

That third case is the one to be careful with. A scan is visually immune to the problem, which makes it invisible until someone tries to search the file or extract its text.

What to do about it

The reliable fix is to make sure the order and the shaping are decided before the text reaches the PDF, not after. In practice that means:

  • Author in a tool that handles RTL natively, and check the export rather than the preview.
  • Do not add RTL text to an existing PDF as a quick edit without checking the result — that is the highest-risk path.
  • Treat a scan with an added text layer as unverified until someone has searched it successfully.
  • When in doubt, send an image. A page flattened to an image cannot reorder or disconnect anything, because there are no characters to reorder. It also stops being searchable, which is the trade-off.

The honest limit

Most PDF editing tools do not do bidi reordering and shaping, and saying so is more useful than implying a setting will fix it. Rifinit's editor can draw Arabic and Hebrew glyphs — it selects a font that covers the characters rather than substituting empty boxes — but it does not perform the reordering and shaping that a native RTL text engine does. For a document that must read correctly in Arabic or Hebrew, produce it in a word processor or layout tool with proper RTL support and verify the exported PDF with the three checks above.

From the running app

These are captures of the shipped Rifinit build, not mockups: what Edit PDF asks for and what it returns. Every workflow in this guide was checked on the same build.

Start screen with title, Choose file dropzone and cloud sources, plus a link for a blank document
Open the PDF in the editor
The ready page after Save and Continue, with the finished PDF name, its size and page count, and the blue Download
Download the edited PDF

Alex Roshid — Editorial lead, Rifinit. More about the author · How we write and review.

Open Edit PDF Read the full guide Browse all tools

Standards and sources: PDF parsing and writing follow the open PDF specification, documented in the Library of Congress format registry; the interface follows WCAG 2.2 (W3C). Rifinit is independent of both organisations.

By the Rifinit team. Published under the Alex Roshid byline. We build, test and document these PDF tools in-house: every guide is written by the same engineers who work on the converters, the editor and the OCR pipeline. Meet the team. Read how we write and review, our privacy policy and terms. Last reviewed .

Follow Rifinit Facebook LinkedIn Pinterest Reddit