html2canvas - onrendered is not working at all
<p>Here goes my code,</p>

<pre><code>var pdf = function() {
        console.log(12);
            var form = $('.container');
            html2canvas(form, {
              onrendered: function(canvas) {
                var pdf1 = new jsPDF();
                var marginLeft=20;
                var marginRight=20
                pdf1.addImage(canvas.toDataURL("image/jpeg"),"jpeg",marginLeft,marginRight)
                var data =pdf1.output("datauristring");
                console.log(data);  
              }
            });
    };
</code></pre>

<p>HTML code is </p>

<pre><code>&lt;div class="container"&gt;
                Sample Text
            &lt;/div&gt;
</code></pre>

<p>In index.html - </p>

<pre><code>&lt;script type = "text/javascript" src="html2canvas.min.js"&gt;&lt;/script&gt;
</code></pre>

<p>I am calling the pdf() method on an action, I am sure the pdf() method is called but not onrendered.
I have tried similar SO response for the html2canvas issue, still i'm not sure why I am not able to make the onrendered working. It is not getting called at all.</p>