i'am trying to generate a word document using apache poi api, and i want to set an arabic sentence into the word, but the words didn't stay on the order !!! for instead of "شهادة بالملك" i get بالملك شهادة
public class word {
public static void main (String [] args) {
XWPFDocument docx = new XWPFDocument();
try {
XWPFParagraph tmpParagraph = docx.createParagraph();
XWPFRun tmpRun = tmpParagraph.createRun();
tmpRun.setText("شهادة بالملك");
tmpRun.setFontSize(18);
tmpRun.setFontFamily("Calibri (Corps)");
tmpRun.setBold(true);
tmpRun.setColor("003894");
tmpParagraph.setAlignment(ParagraphAlignment.LEFT);
tmpRun.setUnderline(UnderlinePatterns.SINGLE);
tmpParagraph.setSpacingAfter(300);
FileOutputStream fos = new FileOutputStream("Word2.docx");
docx.write(fos);
fos.close();
}
catch (Exception e ) {
e.printStackTrace();
}
}
}