GUIDES / Arabic copied from a PDF
Arabic text copied from a PDF is reversed or garbled: how to fix it
PDF is built for printing and viewing, not for getting text back out. Copy Arabic from the wrong kind of PDF and you can get words that start from their last letter, letter shapes that search cannot find, or characters that mean nothing. This guide helps you tell which problem you have from the pasted text alone, fix it with the right tool, and recognise the cases no text tool can fix.
Why Arabic changes when you copy it from a PDF
A PDF does not store sentences the way a Word file does. It stores glyphs (the drawn shapes of letters) and their positions on the page, plus a table that maps each glyph back to a character. When you copy, the viewer reads that table and tries to rebuild the text.
Arabic is drawn with joined letter shapes, and that is where things go wrong. Some PDF producers store the joined shapes themselves instead of the underlying letters, and some store them in the order they appear on the page, left to right. Copy from such a file and you get what the file recorded, not what the author typed.
Unicode is clear that the Arabic presentation forms exist for historical compatibility and that using them in data does not guarantee integrity or interoperability; normal Arabic text is stored in logical (typing) order using the main Arabic block. So copied text has to be turned back into ordinary letters in logical order before you search it, store it or translate it.
Identify the problem from what you pasted
Paste a short paragraph into any plain-text editor and compare it with this table:
| What you see after pasting | Likely cause | What to do |
|---|---|---|
| Words read from their last letter; letters look oddly joined or separate | Presentation forms stored in visual order | Reversed Arabic: Repair reversed text copied from a file |
| Words in the right order, but search cannot find them | Presentation forms in logical order | Cleaner: Repair legacy Arabic presentation forms |
| Text is correct, but every page line became its own line | Page lines copied as-is | Cleaner: Join lines with a space |
| Random Latin letters, boxes or Arabic letters unrelated to the word | Missing or wrong glyph-to-character mapping in the file | No text converter can fix it; use OCR or the source file |
To confirm presentation forms, paste a word or two into Unicode normalization and choose NFKC. Code points starting with U+FE or U+FB are presentation forms; after normalization you should see ordinary letters from the U+06 range:
ﻻ ﺗﻨﺲ
لا تنس
U+FEFB U+0020 U+FE97 U+FEE8 U+FEB2Code points after
U+0644 U+0627 U+0020 U+062A U+0646 U+0633
Settings: Unicode normalization · NFKC
Open the tool: NormalizationNotice that “لا” was a single character in the copied text and becomes two, lam and alef. That one-character ligature is exactly why a search for the normal spelling fails.
Repair reversed words, step by step
- Copy a section of the PDF. Start with one paragraph so you can check the result.
- Open Reversed Arabic and set Goal to Repair reversed text copied from a file.
- Paste the text. The tool converts presentation forms back to ordinary letters, splits lam-alef into two letters and restores each line to typing order.
- Read the result, paying particular attention to numbers, punctuation and English words.
- Copy it or download it as a .txt file, then carry on cleaning if needed.
ﻦﻴﺋﺪﺘﺒﻤﻠﻟ ﺔﻴﺑﺮﻌﻟﺍ ﺔﻐﻠﻟﺍ ﻢﻴﻠﻌﺗ
تعليم اللغة العربية للمبتدئين
Settings: Goal: repair reversed text copied from a file · reverse order on
Open the tool: Reversed ArabicNumbers and Latin words stay left to right inside the line and return, together with brackets, to their place in the sentence:
ﻙ.ﺩ 12.500 :(ﺔﺒﻳﺮﻀﻟﺍ ﻊﻣ) ﻲﻟﺎﻤﺟﻹﺍ
الإجمالي (مع الضريبة): 12.500 د.ك
Settings: Goal: repair reversed text copied from a file · reverse order on
Open the tool: Reversed ArabicThe tool handles up to 20,000 text units per run and works only on text you paste. It does not upload or open the PDF itself, so copy a long document in sections.
When the order is right but the letters are odd
Sometimes the words come out in the right order but the letters are stored as presentation forms. The text looks fine, yet a search for “مرحبا” finds nothing and a form or database may reject it. You do not need to reverse anything. Open the Cleaner and, under Arabic marks, tick Repair legacy Arabic presentation forms.
ﻣﺮﺣﺒﺎ ﺑﻜﻢ ﻓﻲ ﺍﻟﺪﻭﺭﺓ
مرحبا بكم في الدورة
Settings: Cleaner · Repair legacy Arabic presentation forms
Open the tool: CleanerDo not use that option on its own for reversed text. It fixes letter shapes but never changes order, so you end up with ordinary letters that still run backwards:
ﺔﻴﺑﺮﻌﻟﺍ ﺔﻐﻠﻟﺍ
ةيبرعلا ةغللا
Settings: Cleaner · presentation-form repair only
Open the tool: CleanerIf that is what you get, go back to the original copied text and use Repair reversed text copied from a file instead.
What no text tool can repair
If the pasted text shows random Latin letters, boxes, or Arabic letters that have nothing to do with the word, the PDF has no correct mapping from glyphs to characters. This is common with old fonts and files produced in non-standard ways. The copied text simply does not contain the right information, and no converter can guess it. Scanned PDFs are the same story: the page is an image, so there is no text to copy at all.
Your options:
- Ask the document's owner for the source file, such as Word or InDesign, and copy from that.
- Use optical character recognition (OCR). For example, Google Drive's help page explains how to open a PDF or image with Open with > Google Docs to convert it to text, and Arabic is among the supported languages. Proofread the result carefully, especially dots, hamzas and numbers.
- If the passage is short, retyping it may be faster and more accurate than any conversion.
After the repair: a quick check
- Line breaks: a PDF copies every printed line as a separate line. To rejoin a paragraph, use Join lines with a space under Spacing and lines in the Cleaner.
- Invisible characters: copied text may carry direction marks or zero-width spaces. Inspect it in the invisible character inspector before you delete anything.
- Numbers and percentages: a % sign or currency symbol can end up on the other side of its number. Fix those by hand.
- Comparison: if you have part of the original text, check the result against it in Compare.
تتناول هذه الدراسة أثر القراءة اليومية في تحسين الكتابة عند الطلاب.
تتناول هذه الدراسة أثر القراءة اليومية في تحسين الكتابة عند الطلاب.
Settings: Cleaner · Spacing and lines · Join lines with a space
Open the tool: CleanerFor the wider cleanup routine, see cleaning copied Arabic text. For why Arabic breaks in design apps in the first place, read reversed Arabic in Photoshop and other apps.
Frequently asked questions
Why do Arabic words come out backwards when I copy from a PDF?
The software that produced the PDF stored the letters in the order they appear on the page, left to right, usually as ready-joined shapes. Copying gives you back exactly what the file stored.
The PDF looks perfect on screen. Why does the pasted text change?
The viewer draws glyphs at their positions, so the page looks right. Copying relies on the character mapping stored inside the file, and that mapping can be in a different order or simply wrong.
Can missing letters or gibberish be fixed?
Not with a text tool. It means the file never contained the right characters. Use the source file, OCR, or retype the passage.
Can I repair a whole PDF in one go?
The tool works on text you paste, up to 20,000 text units at a time, so copy long documents in sections. It never uploads the file or sends your text to a server.
Does this work for text in images or scanned pages?
No. An image contains no text. Run OCR first, then tidy the result in the Cleaner.
Tools used in this guide
Sources
We checked these pages when writing and updating this guide.
Unicode FAQ: Ligatures, digraphs and presentation forms ↗Unicode FAQ: Bidirectional text ↗Unicode Standard Annex #9: Bidirectional Algorithm ↗Unicode Standard Annex #15: Normalization forms ↗Google Drive Help: Convert PDF and photo files to text ↗