Support for right to left (RTL) text search in the WebViewer

86 views
Skip to first unread message

Support

unread,
Dec 3, 2012, 6:20:24 PM12/3/12
to pdfnet-w...@googlegroups.com
Q:
 
I need support for right to left (RTL) text search in the WebViewer. This is for languages such as Hebrew, Arabic, etc.
If you type characters in reverse order search works, but doesn't work when you write a proper search term:

 

hockey (hebrew letters in proper order - does not work)

yekcoh (hebrew letters in reverse order - search works)
 
-------
A:
 
I guess this should be simple to change in the ReaderControl. After user enters the search terms you can determine if the term is RTL or LTR

 

bool IsRightToLeftChar(uicode_char u) {

  return (0x0590 <= u && u <= 0x05FF) || (0x0600 <= u && u <= 0x06FF) || (0x0750 <= u && u <= 0x077F) || (0xFB50 <= u && u <= 0xFDFF) || (0xFE70 <= u && u <= 0xFEFF);

}

 

If all characters are RTL then you can reverse the order of characters and call the standard search function.

Reply all
Reply to author
Forward
0 new messages