onReady function

Table of Contents
Experimental customizations are not included by default and are extended to the plugin. Please use with caution and proper consent.

Case: #

Trigger custom function or action when viewer has finished loading the document and required files for displaying the PDF.

Demo: #

Process: #

We use onReady function to detect the viewer state. These are added to DEARPDF.defaults variable so that every flipbook on the page uses the customization.

<script>
    jQuery(function(){
        DEARPDF.defaults.onReady = function(app){
            alert("Viewer Ready");
            console.log(app);
        };
    });
</script>
For WordPress, please read on 
How to add Custom Code to WordPress Pages

Leave a Reply

Your email address will not be published.