Arabic text reversed when you copy it from a PDF
The PDF looks right on screen, but when you copy the Arabic and paste it into Word, an email or a chat, the words come out backwards, the letters fall apart or the lines are in the wrong order. Searching the PDF for a word may find nothing, and converting it to Word gives the same mess. The same happens with Persian and Urdu.
Why the copied text is wrong
A PDF is made for looking at, not for reading back. It stores where each letter shape is drawn on the page. When you copy, the viewer has to guess the reading order from that drawing, and for right to left text the guess often fails.
- The letters were drawn in visual order. Many programs that make PDFs reverse Arabic before they draw it, so that it looks right on the page. The file then holds the line from left to right, and a copy gives it to you backwards.
- The file holds ready made letter shapes. Some PDFs store the joined forms of the letters (Unicode presentation forms) rather than ordinary letters. They look right but paste as odd characters, or as letters that search and spell checkers do not recognise.
- The page is a scan. If you cannot select single words at all, the page is a picture and holds no text. Copying cannot work; it needs text recognition.
How to fix it
- Get the text out with a tool that reads Arabic order. PDF to text and PDF to Word on this site give you Arabic, Persian and Urdu text in reading order, with numbers and English words where they belong. Free, no account, and the file is deleted after the job.
- If you already pasted the text and it is backwards, paste it into Fix Arabic text and choose "The letters are apart or backwards". It repairs the text and lists what it changed, so you can check it.
- If the page is a scan, use Image to text, which reads the letters from the scanned page.
- If you make the PDF yourself, make it from the original text with a program that does real shaping, rather than reversing the text first. That keeps the stored order closer to the reading order.
A quick test
Search the PDF for one Arabic word you can see on the page. If the search finds it, the text inside the file is in good order and copying should work in most viewers. If it does not, use one of the tools above to get the text out.
Other Arabic PDF problems
النص العربي معكوس عند نسخه من ملف PDF
يظهر ملف PDF صحيحا على الشاشة، لكن حين تنسخ العربية وتلصقها في Word أو في رسالة أو محادثة تأتي الكلمات معكوسة أو الحروف منفصلة أو الأسطر بترتيب خاطئ. وقد لا يجد البحث داخل الملف أي كلمة، ويعطي تحويله إلى Word النتيجة المعطوبة نفسها. ويحدث الشيء نفسه مع الفارسية والأردية.
لماذا يخرج النص المنسوخ خاطئا
ملف PDF مصنوع للعرض لا للقراءة منه. فهو يحفظ موضع رسم كل شكل حرف على الصفحة. وعند النسخ يضطر برنامج العرض إلى تخمين ترتيب القراءة من هذا الرسم، وفي النص الذي يُكتب من اليمين إلى اليسار كثيرا ما يخطئ التخمين.
- رُسمت الحروف بالترتيب المرئي. برامج كثيرة تصنع ملفات PDF تقلب العربية قبل رسمها لتبدو صحيحة على الصفحة، فيحفظ الملف السطر من اليسار إلى اليمين، ويعطيك النسخ نصا معكوسا.
- الملف يحفظ أشكال الحروف الجاهزة. بعض الملفات تحفظ أشكال الحروف المتصلة (Presentation Forms في يونيكود) بدل الحروف العادية، فتبدو صحيحة لكنها تُلصق رموزا غريبة أو حروفا لا يتعرف عليها البحث ولا المدقق الإملائي.
- الصفحة صورة ممسوحة. إذا لم تستطع تحديد كلمة واحدة فالصفحة صورة ولا نص فيها، والنسخ لا ينفع، وتحتاج إلى التعرف الضوئي على الحروف (OCR).
كيف تصلحها
- استخرج النص بأداة تقرأ الترتيب العربي. أداتا PDF إلى نص وPDF إلى Word في هذا الموقع تعطيانك النص العربي والفارسي والأردي بترتيب القراءة، والأرقام والكلمات الإنجليزية في أماكنها. مجانا وبدون حساب، ويُحذف الملف بعد العمل.
- إذا كنت لصقت النص وظهر معكوسا، الصقه في إصلاح النص العربي واختر أن الحروف منفصلة أو معكوسة. تصلح الأداة النص وتعرض ما غيرته لتراجعه.
- إذا كانت الصفحة صورة ممسوحة، استعمل تحويل الصورة إلى نص، فهي تقرأ الحروف من الصفحة الممسوحة.
- إذا كنت تنشئ الملف بنفسك، أنشئه من النص الأصلي ببرنامج يربط الحروف فعلا بدل قلب النص أولا، فيبقى الترتيب المحفوظ أقرب إلى ترتيب القراءة.
اختبار سريع
ابحث داخل الملف عن كلمة عربية تراها على الصفحة. إن وجدها البحث فالنص داخل الملف بترتيب جيد، وينجح النسخ في معظم برامج العرض. وإن لم يجدها فاستخرج النص بإحدى الأدوات أعلاه.