Why Arabic text copied from a PDF comes out reversed, and how to fix it
What a PDF stores instead of sentences, why Arabic copies backwards, and how to get the text out in reading order without uploading the file.
By OpenAnyDoc ·
The short answer
Arabic text comes out reversed or broken because a PDF does not store sentences. It stores the shape of each letter and its place on the page, and many PDF readers copy those shapes in the order they sit on the page, from left to right, so the words come out backwards or with separated letters. Open the file in OpenAnyDoc's PDF viewer, or save its text with PDF to text or PDF to Word: they rebuild Arabic lines in reading order before you copy them.
Why it happens
A Word document or a web page keeps text as it was typed: the letters in typing order, and the program shapes and orders them for the screen. A PDF is closer to a printout. It keeps the drawn shapes of the letters with the place on the page where each one goes, plus only as much information about the text behind them as the program that made the PDF chose to write.
The page still looks right, because each shape is drawn where it belongs; the trouble shows only when the text is taken out, and each reader turns the shapes back into text in its own way. For Arabic, three things can go wrong:
- Letters stored in visual order. Some programs place every Arabic letter on its own, left to right as it appears on the page. A reader that copies them in that order gives you each word backwards and the words of the line in reverse.
- Joined shapes instead of letters. Arabic letters change shape at the start, middle and end of a word. Some PDFs record those shapes, called presentation forms, instead of the ordinary letters, so pasted text can look right yet not match when you search for it, or show letters that do not join.
- Mixed lines. A number, a date or an English word inside an Arabic sentence runs left to right, and brackets face the other way in right-to-left text. A reader that ignores direction moves them to the wrong place or flips the brackets.
Copy Arabic in reading order, with nothing uploaded
OpenAnyDoc's PDF tools rebuild right-to-left lines before you see the text. When a line is mostly Arabic, its pieces are put back in reading order from right to left, an English word or a number inside it keeps its own order, brackets are turned back into the character that was typed, and joined shapes become ordinary Arabic letters. Pick the tool that matches what you need:
- A few lines: open the file in the PDF viewer, select the text and copy it. Ctrl+F (Cmd+F on a Mac) searches the Arabic text and highlights the matches.
- All of the text: PDF to text saves every page as a .txt file, Arabic in reading order, with optional markers where each page starts.
- Text you want to edit: PDF to Word writes an editable .docx with Arabic paragraphs set right to left, keeping headings, lists and pictures.
Private files stay on your device
The PDF is read by your own browser and never uploaded, so this works for contracts, statements and other documents you would not send to a website. You can check that nothing is uploaded in your browser's network panel. Once the page has loaded, the viewer keeps working without an internet connection, and PDF to text does too after you have used it once.
Nothing to select? The PDF is a scan
A scanned PDF, or one made from phone photos, holds a picture of each page and no text at all. Nothing can be selected, search finds nothing, and PDF to text tells you it found no text. Run OCR PDF first: it reads the words on each page, in Arabic, English or both, and lays them over the page as invisible text, so the page looks exactly as before. Then copy from the new file in the viewer, or open it in PDF to text or PDF to Word.
Text recognition makes mistakes, more so on blurry, small or handwritten text, so check names, numbers and dates against the page before you rely on them.
Check the result yourself
A one-minute test tells you whether a copy is right:
- Pick a line and note its first word, the one at its right edge. Copy the line and paste it into a note or an email.
- The first word should be at the start of the pasted line (on the right in a right-to-left editor), and the letters of each word should join as they do on the page.
- If the last word comes first, or the letters stand apart, the copy is reversed or broken: copy it again from the PDF viewer here.
- Search the PDF for an Arabic word you can see on the page. If the viewer finds and highlights it, the text inside the file is usable.
What it cannot fix
Some limits are worth knowing before you start:
- Tables come out as lines of text, not as a table. PDF to Word keeps the columns of a line apart with tab stops; PDF to Excel reads tables into cells.
- A PDF that needs a password to open must be unlocked first; Unlock PDF removes the password when you know it.
- If a PDF's letters copy as symbols in every reader, the file has no usable text behind them. Treat it like a scan: OCR PDF leaves pages that already have text as they are unless you choose otherwise, so choose to read those pages too.
Questions?
Write to support@openanydoc.com and describe how the copied text looks (no personal data).