Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Development and suggestions about third part tool integration.
Cordova, Xamarin, Basic4Android topics are listed here.
  • Page:
  • 1

TOPIC:

How to detect Radaee PDF close event 6 years 10 months ago #12474

  • stacy_brenes
  • stacy_brenes's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 7
  • Thank you received: 0
I am trying to detect when the user closes the PDF reader so that I can store the page he is on when he closes it.

I do not see any methods for this event in the plugins js file. I know we have the RadaeePDFPlugin.getPageNumber function, but I still need to be able to bind it to the closing of the PDF reader to get the last page the user reads.

Does this plugin have a method that I missed, or is there a way to manipulate the getPageNumber function so that I can get the page the user is on when he closes the PDF reader.

Thanks in advance,
-Stacy.

Please Log in or Create an account to join the conversation.

How to detect Radaee PDF close event 6 years 10 months ago #12482

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
You can use the following callbacks:
Android (com.radaee.cordova.RadaeePDFPlugin.java):
RadaeePDFPlugin.willCloseReader
iOS:
WillCloseReader in RadaeePDFPluginDelegate

Please Log in or Create an account to join the conversation.

How to detect Radaee PDF close event 6 years 10 months ago #12483

  • stacy_brenes
  • stacy_brenes's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 7
  • Thank you received: 0
Can you provide a working example of how to use the functions as callbacks?
I'm struggling with how to correctly call the RadaeePDFPlugin.willCloseReader() to be able to detect when the user closes the reader.

Please Log in or Create an account to join the conversation.

How to detect Radaee PDF close event 6 years 10 months ago #12485

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
It's a callback (listener) that will be fired immediately before the closure of the PDF, it's already implemented in the demo project.

You need to integrate your code inside this method (in the classes mentioned earlier)

Please Log in or Create an account to join the conversation.

How to detect Radaee PDF close event 6 years 9 months ago #12599

  • stacy_brenes
  • stacy_brenes's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 7
  • Thank you received: 0
it's already implemented in the demo project.
it's already implemented in the demo project.
'it's already implemented in the demo project' is there git repo I can clone the demo project from?

Please Log in or Create an account to join the conversation.

How to detect Radaee PDF close event 6 years 9 months ago #12603

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
You can get cordova plugin from RadaeePDF-Cordova Plugin
For example (Android), in RadaeePDFPlugin.java you can find that it implements RadaeePluginCallback.PDFReaderListener
public interface PDFReaderListener {
        void willShowReader();
        void didShowReader();
        void willCloseReader();
        void didCloseReader();
        void didChangePage(int pageno);
        void didSearchTerm(String query, boolean found);
    }

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum