Open kenneth-apuyan opened 1 year ago
This seems to be the same issue as discussed in #432. I have experienced this issue before and the solution I have described here has fixed the issue for me. So, in your case, the "RTL here" should be replaced with your Arabic text, "LTR here" with your English insertions.
This seems to be the same issue as discussed in #432. I have experienced this issue before and the solution I have described here has fixed the issue for me. So, in your case, the "RTL here" should be replaced with your Arabic text, "LTR here" with your English insertions.
Thanks :D. It worked on some parts of my template. Sadly, this seems to works only if you know what texts are LTR and RTL i.e. static text. For dynamic text, i.e. provided by a user that will then be embedded to the html template, you don't have any control on it so it could be an arabic text, an english text or a mixed of both. You can't separate them via spans with the LTR/RTL beforehand.
This issue happens when the line starts with arabic followed by english words. They interchange places or get all mixed up. I already applied the below code :
PdfRendererBuilder builder = new PdfRendererBuilder();
builder.useUnicodeBidiSplitter(new ICUBidiSplitter.ICUBidiSplitterFactory());
builder.useUnicodeBidiReorderer(new ICUBidiReorderer());
builder.defaultTextDirection(BaseRendererBuilder.TextDirection.LTR);