Text-to-speech for our Android viewer

The Android PDF text-to-speech feature is enabled by default. To disable the text-to-speech action in the TextSelectionToolbar, you need to register an OnContextualToolbarLifecycleListener on your activity and filter the action right before the toolbar is displayed. More details on this technique can be found in our toolbar customization guide:

override fun onPrepareContextualToolbar(toolbar: ContextualToolbar<*>) {
(toolbar as TextSelectionToolbar?)?.setMenuItemGroupingRule { flatItems, _ ->
flatItems.filter { it.id != R.id.pspdf__text_selection_toolbar_item_speak }
}
}
Text Speech