Knowledge Base - How to manage reader callbacks

Knowledge Base - How to manage reader callbacks

This article shows how to manage callbacks from reader:

In your JS you can add a function to register callbacks:

        function registerCallbacks()

        {

            RadaeePDFPlugin.willShowReaderCallback(willShowReader);

            RadaeePDFPlugin.didShowReaderCallback(didShowReader);

            RadaeePDFPlugin.willCloseReaderCallback(willCloseReader);

            RadaeePDFPlugin.didCloseReaderCallback(didCloseReader);

            RadaeePDFPlugin.didChangePageCallback(function(message){didChangePage(message);});

            RadaeePDFPlugin.didSearchTermCallback(function(message){didSearchTerm(message);});

            RadaeePDFPlugin.didTapOnPageCallback(function(message){didTapOnPage(message);});

            RadaeePDFPlugin.didTapOnAnnotationOfTypeCallback(function(message){didTapOnAnnotationOfType(message);});

        }

 

Then add a function to manage each callback and execute your custom actions:

        

        function willShowReader()

        {

            console.log("--- Callback: willShowReader");

        }

        function didShowReader()

        {

            console.log("--- Callback: didShowReader");

        }

        function willCloseReader()

        {

            console.log("--- Callback: willCloseReader");

        }

        function didCloseReader()

        {

            console.log("--- Callback: didCloseReader");

        }

        function didChangePage(page)

        {

            console.log("--- Callback: didChangePage: " + page);

        }

        function didSearchTerm(term)

        {

            console.log("--- Callback: didSearchTerm: " + term);

        }

        function didTapOnPage(page)

        {

            console.log("--- Callback: didTapOnPage: " + page);

        }

        function didTapOnAnnotationOfType(type)

        {

            console.log("--- Callback: didTapOnAnnotationOfType: " + type); 

        }

Applies To

RadaeePDF SDK for Cordova

Details

Created : 2017-08-31 08:31:17, Last Modified : 2017-12-05 08:52:48