Open eladsof opened 9 years ago
Any updates about this issue?
My Solution is
Create a helper function that takes a text and return it formatted while reversing the rtl language Arabic: `export function handleArabicCharacters(message: string) { let arabic = []; let english = [];
var regex = new RegExp( "[\u0600-\u06ff]|[\u0750-\u077f]|[\ufb50-\ufc3f]|[\ufe70-\ufefc]" );
arabic = message.split(" ").filter((e) => regex.test(e));
english = message.split(" ").filter((e) => !regex.test(e));
return ${english.join(" ")} ${arabic.reverse().join(" ")}
;
}`
then import it and use it inside the docDefinition obj like this
columns: [ { text: 'Remarks:', style: { alignment: 'left', bold: true, fontSize: 11 }, margin: [0, 6, 0, 3], width: 70, }, { text:
${handleArabicCharacters(orderData?.order_remarks)}, style: { alignment: 'right', font: 'Arial', fontSize: 10 }, margin: [0, 6, 0, 3], }, ],
Change the regex to match the language needed. I hope this can help
It's working fine for string but still facing issue in layout direction .
I have been facing this problem for two years and it has not been resolved yet. Do I have to search for another tool? The problem has existed since 2015. This is very bad. Why don't you solve the problem? @liborm85
+1
+1
+1
why this issue is not fixed ?
@itaisir Try read my post above.
Wow. About 9 years since the start of topic, still no update for RTL layouts and language. It would be great if this option added.
Hi,
Is there support for right to left language? I was able to change the font but the letter are written in the wrong order (LTR).