My PDF uses a right to left language, how do I view it in my PDFNet SDK Viewer and allow text selection in the correct order?

Question: I am using the PDFNet SDK PDFViewCtrl to view my documents and some of my PDFs use Right-to-Left languages, such as Arabic and Hebrew. How do I allow for text selection for operations like highlighting or underlying for these languages?

Answer:
The PDFViewCtrl now includes the option to set the language order for the PDFViewCtrl with the SetRightToLeftLanguage to allow for this. The samples included in the PDFNet with CPP Viewer contain an example project, PDFViewSimpleTest. To set the text order in this project, use the following after the PDFViewCtrl has been instantiated:

m_view->SetRightToLeftLanguage(true);

1 Like