Hi Adham. I have some experience with ICU4J. I tried to read the LTR text in Arabic and convert it to RTL Text I changed the numbers from English to Arabic and set the alignment to RTL. This is simple code that does the job. I hope my little experience helped you with this: demos on the ICU4J website
PdfReader reader = new PdfReader(INPUTFILE); String txt=PdfTextExtractor.getTextFromPage(reader, 1); BiDiClass bidiClass = new BiDiClass(); String arabicNumber = bidiClass.englishToArabicNumber(txt); String out=bidiClass.makeLineLogicalOrder(arabicNumber, true); System.out.println(out);
and this is BiDiClass
import com.ibm.icu.text.Bidi; import com.ibm.icu.text.Normalizer;
Ibraheem osama
source share