how to change direction of text from ltr to rtl in docxtemplater?

442 Views Asked by At

I'm inserting text into a Microsoft Word document using the docxtemplater module.

I'm having trouble inserting Arabic text.

doc.setData({
country: 'الهند'
});

output

enter image description here

1

There are 1 best solutions below

1
On

I'm not exactly sure how to use the docxtemplater module, but the <w:rtl> tag should help you. I'm not exactly sure how to implement the solution but something with this idea in mind might work (:

country: '<w:rtl>الهند</w:rtl>'

(apologies if the above is invalid, I am not familiar with docxtemplater but have found the <w:rtl> tag and it seems to be what you're looking for.)