I have java code that writes arabic characters with the help of itext 5.5 and xmlworker jars, but its writing left to right even after writer.setRunDirection(PdfWrit
As documented, this is not supposed to work:
writer.setRunDirection(PdfWriter.RUN_DIRECTION_RTL);
Arabic (and Hebrew) can only be rendered correctly in the context of ColumnText
and PdfPCell
. In other words: if you want to use Arabic from XML Worker, you need to create an ElementList
and then add the elments to a ColumnText
object as is done here.
You need to set the run direction at the level of the ColumnText
object.