title: Using addHTML function from jsPDF in AngularJS
body: <p>I'm trying to create custom printout in my application using jsPDF plugin. Applicaiton uses AngularJs frame work. I tried many different example codes but nothing works...
  (<a href="http://jsfiddle.net/rpaul/p4s5k59s/5/" rel="nofollow">http://jsfiddle.net/rpaul/p4s5k59s/5/</a>, <a href="http://mrrio.github.io/jsPDF/" rel="nofollow">http://mrrio.github.io/jsPDF/</a> ->addHtml, ...).</p>
  
  <p>My code:</p>
  
  <p>Plugins loads:</p>
  
  <pre><code>...resolve: {
              loadPlugin: function ($ocLazyLoad) {
                  return $ocLazyLoad.load([
                      {
                          serie: true,
                          name: 'Chart',
                          files: [ 'src/plugins/html2canvas.js', 'src/plugins/jsPDF/jspdf.debug.js']...
  </code></pre>
  
  <p>Button that triggers the action:</p>
  
  <pre><code>&lt;button type="button" class="btn btn-w-m btn-success" ng-click="x21ot.printDocument()"&gt;Print&lt;/button&gt;
  </code></pre>
  
  <p>And the called function:</p>
  
  <pre><code>    this.printDocument = function(){
          var pdf = new jsPDF('p','pt','a4');
           pdf.addHTML($("#chart1"),function() {
               pdf.save('web.pdf');
           });
      }
  </code></pre>
  
  <p>When the action is called nothing happens. I tried different output method : <em>doc.output('dataurlnewwindow');</em> but it does not work.</p>
  
  <p>I have debugged <em>addHTML</em> function and found there is onrender event that never triggers. </p>
  
  <p>Is this an Angular problem or am I doing something wrong ?</p>