Justify alignment breaks RTL rendering - Aspose PDF for Java

We have encountered multiple issues related to RTL (Right-To-Left) rendering of Arabic text in Aspose.PDF for Java. While most of them have workarounds or acceptable limitations, this particular case — justified alignment breaks proper RTL (Right-To-Left) rendering when generating Arabic text — appears to have no viable solution at this time.

While Arabic text is rendered correctly with HorizontalAlignment.Right or Left, applying HorizontalAlignment.Justify causes the direction to break — the text appears left-to-right, and characters are no longer shaped or ordered correctly.

Even using an HTML div fragment with

dir=“rtl” style=“text-align: justify”

fails to preserve justified layout — the text retains RTL orientation but is no longer properly justified.

Based on our tests with recent versions (24.x), there seems to be no reliable way to combine proper RTL rendering with justified alignment for Arabic RTL text in Java.

@adam44

It appears that you are experiencing issues with Right-To-Left (RTL) rendering of Arabic text when using justified alignment in Aspose.PDF for Java. Currently, while the text is rendered correctly with right or left alignment, applying justified alignment disrupts the proper RTL rendering, causing the text to appear left-to-right and affecting the character shaping and ordering.

Unfortunately, even attempts to use HTML fragments with RTL direction and justified text alignment do not yield the desired results, as the text maintains its RTL orientation but fails to justify correctly. Based on your tests with recent versions of Aspose.PDF, it seems that there is no reliable solution available to achieve both proper RTL rendering and justified alignment for Arabic text at this time.

For further assistance, you may want to explore the Aspose community forums or consider submitting a feature request to the development team, as they may be able to provide insights or updates on this issue in future releases.

If you have any more questions or need further assistance, feel free to ask!