Writing RTL (Right To Left) text in PDF using PDFNet SDK

57 views
Skip to first unread message

Support

unread,
Jan 18, 2013, 8:06:52 PM1/18/13
to pdfne...@googlegroups.com

Q:

 I want to use PDFNet to output some RTL (Right To Left) text in PDF.  Do you have sample for this?  
Also, do you know if PDF or PDFNet has any issues showing languages that are CTL and RTL based?
 
---------------
A:
 

PDF format itself does not have any specific support for right-to left languages. Characters within a text run are always placed in left to right order.

 

So if you want to place some RTL string you should reverse the order of characters in the string.

To determine if a string has any RTL characters you could use the following utility function:

 

inline bool IsRightToLeftChar(Unicode u) {

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

}

 

PDFNet rasterizers/viewers do not have any issues showing RTL, LTR, or vertical text.

Reply all
Reply to author
Forward
0 new messages