Arabic letters separated in a PDF: why it happens and how to fix it
You made a PDF and the Arabic came out as single letters standing apart: م ر ح ب ا instead of مرحبا. Often the words also read backwards. The text you typed is usually fine. What went wrong is the step that turned it into a PDF. The same happens with Persian and Urdu.
Why the letters come apart
An Arabic letter changes its shape with its place in the word: one form at the start, one in the middle, one at the end and one on its own. Some pairs merge into one shape, such as lam and alef (لا). Choosing the right form for every letter is called shaping, and it is the job of the program that writes the PDF.
- The program does no shaping. Many PDF libraries and older editors place each letter in its basic form, one after the other. The result is letters apart, and often in left to right order as well.
- The text was edited inside an existing PDF. A PDF stores drawn shapes at fixed places, not sentences. Most tools that change text inside a PDF cannot shape Arabic, so the lines you edit come apart even when the rest of the file is fine.
- The viewer is at fault. Now and then the file is fine and one PDF viewer draws it badly. If the same file looks right in a browser or another viewer, the file is not the problem.
How to fix it
- If you have the text, paste it into RTL PDF, pick a font and paper size and download the PDF. The letters are shaped and the lines run right to left, with numbers and English words in their right order. Free, no account.
- If you need to write on an existing PDF (a form, a contract, a certificate), open it in Add text to a PDF, click where the text goes and type. The new text is shaped before it is placed.
- If all you have is the broken text, for example copied out of the bad PDF, paste it into Fix Arabic text. It joins the letters and puts the lines back in reading order, and tells you what it changed so you can check it.
- In Word or LibreOffice, set the paragraph direction to right to left, choose a font that has Arabic letters, and save with the program's own "Save as PDF" or "Export as PDF" rather than a separate PDF printer.
How to check the result
- Every word is joined, and the line reads from right to left.
- Numbers, dates and phone numbers are in their right order.
- Open the file in a second viewer, such as your browser. If both show it the same, the file itself is right.
Other Arabic PDF problems
الحروف العربية منفصلة في ملف PDF: السبب وطريقة الإصلاح
أنشأت ملف PDF فظهرت العربية حروفا منفصلة كل حرف وحده: م ر ح ب ا بدل مرحبا، وكثيرا ما تُقرأ الكلمات معكوسة أيضا. النص الذي كتبته سليم في الغالب، والخطأ في الخطوة التي حولته إلى PDF. ويحدث الشيء نفسه مع الفارسية والأردية.
لماذا تنفصل الحروف
يتغير شكل الحرف العربي بحسب موضعه في الكلمة: شكل في أولها، وشكل في وسطها، وشكل في آخرها، وشكل منفرد. وبعض الحروف تتحد في شكل واحد مثل اللام والألف (لا). اختيار الشكل الصحيح لكل حرف يسمى ربط الحروف، وهو عمل البرنامج الذي يكتب ملف PDF.
- البرنامج لا يربط الحروف. كثير من مكتبات PDF والمحررات القديمة تضع كل حرف بشكله الأساسي واحدا بعد الآخر، فتظهر الحروف منفصلة، وغالبا من اليسار إلى اليمين أيضا.
- عُدّل النص داخل ملف PDF موجود. ملف PDF يحفظ أشكالا مرسومة في مواضع ثابتة لا جملا. ومعظم أدوات تعديل النص داخل الملف لا تربط الحروف العربية، فتنفصل الأسطر المعدلة حتى لو كان باقي الملف سليما.
- المشكلة في برنامج العرض. أحيانا يكون الملف سليما ويعرضه برنامج واحد بشكل خاطئ. إذا ظهر الملف نفسه صحيحا في المتصفح أو في برنامج آخر، فالملف ليس هو المشكلة.
كيف تصلحها
- إذا كان النص عندك، الصقه في RTL PDF، واختر الخط ومقاس الورق، ثم نزّل الملف. تتصل الحروف وتسير الأسطر من اليمين إلى اليسار، وتبقى الأرقام والكلمات الإنجليزية بترتيبها الصحيح. مجانا وبدون حساب.
- إذا أردت الكتابة على ملف PDF موجود (نموذج أو عقد أو شهادة)، افتحه في أضف نصا إلى PDF، واضغط حيث تريد النص واكتب. تُربط حروف النص الجديد قبل وضعه في الملف.
- إذا لم يكن عندك إلا النص المعطوب، كأن تكون نسخته من الملف السيئ، الصقه في إصلاح النص العربي. تربط الأداة الحروف وتعيد الأسطر إلى ترتيب القراءة، وتخبرك بما غيرته لتراجعه.
- في Word أو LibreOffice، اجعل اتجاه الفقرة من اليمين إلى اليسار، واختر خطا فيه حروف عربية، واحفظ بأمر "حفظ بتنسيق PDF" أو "تصدير إلى PDF" في البرنامج نفسه بدل طابعة PDF منفصلة.
كيف تتأكد من النتيجة
- كل كلمة متصلة الحروف، والسطر يُقرأ من اليمين إلى اليسار.
- الأرقام والتواريخ وأرقام الهواتف بترتيبها الصحيح.
- افتح الملف في برنامج عرض ثانٍ مثل المتصفح. إن ظهر بالشكل نفسه فالملف نفسه سليم.