Some test text!

Loading...
Guides
Viewer Events (Android)

Viewer events

PDFTron SDK allows you to detect and act in response to various events.

PDF Viewer Events

This tutorial only applies to Xamarin.Android.

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:

EventDescription
onTabDocumentLoadedCalled when document associated with a tab is loaded.
onTabHostShownCalled when the tab host has been shown.
onTabHostHiddenCalled when the tab host has been hidden.
onLastTabClosedCalled when the last tab in the tab host has been closed, and therefore there are no more tabs.
onTabChangedCalled when a new tab has been selected excluding the initial tab.
onNavButtonPressedCalled 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:

EventDescription
onTabDocumentLoadedCalled when the document has been loaded.
onOpenAddNewTabCalled when a new tab has been opened.
onTabPausedCalled when the tab fragment is paused.
onDownloadedSuccessfulCalled 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 .

Get the answers you need: Support

Upcoming Webinar: PDFTron SDK Tech Review | Nov 29, 2022 at 2 pm ET

PDFTron SDK

The Platform

NEW

© 2022 PDFTron Systems Inc. All rights reserved.

Privacy

Terms of Use