Supporting right-to-left (RTL) language documents in Android

To support right-to-left (RTL) language documents, the Apryse SDK provides a high-level API for changing the reading direction of documents in your document viewer.

Apryse Docs Image

If you are using DocumentActivity or PdfViewCtrlTabHostFragment2, you can enable right-to-left (RTL) support in your document viewer by setting it with ViewerConfig:

1ViewerConfig.Builder builder = new ViewerConfig.Builder();
2ViewerConfig config = builder
3 .fullscreenModeEnabled(true)
4 .multiTabEnabled(true)
5 .documentEditingEnabled(true)
6 .longPressQuickMenuEnabled(true)
7 // ...
8 .rightToLeftModeEnabled(true) // Enable RTL mode, must also call showRightToLeftOption
9 .showRightToLeftOption(true) // Show RTL toggle button in view mode dialog
10 .build();

Java

1ViewerConfig.Builder builder = new ViewerConfig.Builder();
2ViewerConfig config = builder
3 .FullscreenModeEnabled(true)
4 .MultiTabEnabled(true)
5 .DocumentEditingEnabled(true)
6 .LongPressQuickMenuEnabled(true)
7 // ...
8 .RightToLeftModeEnabled(true) // Enable RTL mode, must also call showRightToLeftOption
9 .ShowRightToLeftOption(true) // Show RTL toggle button in view mode dialog
10 .Build();

Note that if you call rightToLeftModeEnabled you must also call showRightToLeftOption in order for right-to-left (RTL) mode to be enabled.

If you would like more granular control over your document viewer, you can enable right-to-left (RTL) directly in PDFViewCtrl by calling PDFViewCtrl.setRightToLeftLanguage(true).

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales