How do write mixed RTL and LTR text using ElementWriter?

Question:

I want to write mixed RTL and LTR text, e.g. Arabic and English. How can I do that using ElementWriter?

Answer:

Great question. Attached is code which will do what you want. You will observe a few things in the code.

a) Shaping is used

b) RTL text has to be “reversed”.

c) The LTR and RTL text has to be shaped and written separately.

Note, you may be interested in our new DocumentCreation API.

ElementBuilderTest.cs (3.6 KB)