> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/android/viewer/rtl-support.md).

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

Enhance your document viewer with Apryse SDK's RTL language support. Enable right-to-left mode easily with ViewerConfig for a seamless reading experience. Learn more about enabling RTL in your PDF vie

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.

![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-17c6de4c893c82e37736367178f68940218bed3c%2F7ad05b69228fc07c9a31b7ebd9c30b10dc991ede-1080x2220.gif?alt=media)

If you are using [DocumentActivity](/android/open-save-document/open/activity.md) or [PdfViewCtrlTabHostFragment2](/android/open-save-document/open/fragment.md), you can enable right-to-left (RTL) support in your document viewer by setting it with [ViewerConfig](/android/viewer/fragment-config.md):

{% tabs %}
{% tab title="Java" %}
{% code lineNumbers="true" %}

```java
ViewerConfig.Builder builder = new ViewerConfig.Builder();
ViewerConfig config = builder
    .fullscreenModeEnabled(true)
    .multiTabEnabled(true)
    .documentEditingEnabled(true)
    .longPressQuickMenuEnabled(true)
    // ...
    .rightToLeftModeEnabled(true)   // Enable RTL mode, must also call showRightToLeftOption
    .showRightToLeftOption(true)    // Show RTL toggle button in view mode dialog
    .build();
```

{% endcode %}
{% endtab %}

{% tab title="Kotlin" %}
{% code lineNumbers="true" %}

```kotlin
val builder = ViewerConfig.Builder()
val config = builder
    .fullscreenModeEnabled(true)
    .multiTabEnabled(true)
    .documentEditingEnabled(true)
    .longPressQuickMenuEnabled(true)
    // ...
    .rightToLeftModeEnabled(true)   // Enable RTL mode, must also call showRightToLeftOption
    .showRightToLeftOption(true)    // Show RTL toggle button in view mode dialog
    .build()
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Java" %}
{% code lineNumbers="true" %}

```java
ViewerConfig.Builder builder = new ViewerConfig.Builder();
ViewerConfig config = builder
    .FullscreenModeEnabled(true)
    .MultiTabEnabled(true)
    .DocumentEditingEnabled(true)
    .LongPressQuickMenuEnabled(true)
    // ...
    .RightToLeftModeEnabled(true)   // Enable RTL mode, must also call showRightToLeftOption
    .ShowRightToLeftOption(true)    // Show RTL toggle button in view mode dialog
    .Build();
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% hint style="info" %}
Note that if you call `rightToLeftModeEnabled` you must also call `showRightToLeftOption` in order for right-to-left (RTL) mode to be enabled.
{% endhint %}

If you would like more granular control over your document viewer, you can enable right-to-left (RTL) directly in [PDFViewCtrl](/android/open-save-document/open/view.md) by calling `PDFViewCtrl.setRightToLeftLanguage(true)`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/android/viewer/rtl-support.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
