Right-to-left text search

Q:
How can we use TextSearch to find right to left text? Is there any separate method to be used for arabic text?

A:

Since for right to left text in PDF the order of characters in memory (logical) is the same as the order in which they are displayed (visual), you have to write your queries accordingly. ( More on text directionality )

So, for example, if you are searching for the word “جبل”(\u062c\u0628\u0644) the text search pattern will be “لبج”(\u0644\u0628\u062c) as it appears in memory(PDF content stream).