PDF Viewer Events

PdfViewCtrlTabHostFragment2 events

Event listeners can be added to a PdfViewCtrlTabHostFragment2 to listen for document viewer events. This can be done by adding a TabHostListener using PdfViewCtrlTabHostFragment2.addHostListener(). Some useful events include:

Event

Description

onTabDocumentLoaded

Called when document associated with a tab is loaded.

onTabHostShown

Called when the tab host has been shown.

onTabHostHidden

Called when the tab host has been hidden.

onLastTabClosed

Called when the last tab in the tab host has been closed, and therefore there are no more tabs.

onTabChanged

Called when a new tab has been selected excluding the initial tab.

onNavButtonPressed

Called when navigation button has been pressed.

For a full list of events, please take a look at the TabHostListener API documentation.

PdfViewCtrlTabFragment2 events

Similarly, PdfViewCtrlTabFragment2 has its own events and and you can listen for them by adding a TabListener using PdfViewCtrlTabFragment2.setTabListener(). Some useful events include:

Event

Description

onTabDocumentLoaded

Called when the document has been loaded.

onOpenAddNewTab

Called when a new tab has been opened.

onTabPaused

Called when the tab fragment is paused.

onDownloadedSuccessful

Called when download successfully has been finished.

For a full list of events, please take a look at the TabListener API documentation.

ToolManager events

Touch events, annotation events, quick menu events and tool change events in the document viewer are all managed by the ToolManager. You can learn more about ToolManager events here.

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales