title: jsPDF doesn't work in Chrome, only Firefox & Safari
body: <p>I'm trying to export an application to a PDF using jsPDF. After browsing around the web, grabbing a line of code here, a section there - I have managed to get it working... <em>somewhat</em>.</p>
  <p>It works in Firefox &amp; Safari, <strong>but not in Chrome.</strong></p>
  <p>JS-Files used (from jsPDF). Perhaps overkill. Along with Jquery.</p>
  
  <pre><code>    &lt;script type=&quot;text/javascript&quot; src=&quot;PDF/standard_fonts_metrics.js&quot;&gt;&lt;/script&gt; 
      &lt;script type=&quot;text/javascript&quot; src=&quot;PDF/split_text_to_size.js&quot;&gt;&lt;/script&gt;               
      &lt;script type=&quot;text/javascript&quot; src=&quot;PDF/from_html.js&quot;&gt;&lt;/script&gt;
      &lt;script type=&quot;text/javascript&quot; src=&quot;PDF/addhtml.js&quot;&gt;&lt;/script&gt;               
      &lt;script type=&quot;text/javascript&quot; src=&quot;PDF/addimage.js&quot;&gt;&lt;/script&gt;
  </code></pre>
  <p>The code I'm using is this:</p>
  <pre><code>&lt;script type=&quot;text/javascript&quot;&gt;
  function demoFromHTML() {
    $('#listAreaPDF').css(&quot;display&quot;, &quot;block&quot;);
  
    var pdf = new jsPDF('p', 'pt', 'letter');
    // source can be HTML-formatted string, or a reference
    // to an actual DOM element from which the text will be scraped.
    source = $('#listAreaPDF')[0];
  
    pdf.setFontSize(24);
    pdf.text(35, 40, &quot;PDF Title here&quot;);
  
    pdf.setFontSize(10);
    pdf.text(500, 40, &quot;Company Name AB&quot;);
  
    // we support special element handlers. Register them with jQuery-style 
    // ID selector for either ID or node name. (&quot;#iAmID&quot;, &quot;div&quot;, &quot;span&quot; etc.)
    // There is no support for any other type of selectors 
    // (class, of compound) at this time.
    specialElementHandlers = {
      // element with id of &quot;bypass&quot; - jQuery style selector
      '#bypassme': function (element, renderer) {
        // true = &quot;handled elsewhere, bypass text extraction&quot;
        return true
      }
    };
    margins = {
      top: 80,
      bottom: 60,
      left: 40,
      width: 522
    };
  
  
    // all coords and widths are in jsPDF instance's declared units
    // 'inches' in this case
    pdf.fromHTML(
      source, // HTML string or DOM elem ref.
      margins.left, // x coord
      margins.top, {// y coord
        'width': margins.width, // max width of content on PDF
        'elementHandlers': specialElementHandlers
      },
      function (dispose) {
        html2canvas($(&quot;#presentationArea&quot;), {
          onrendered: function (canvas) {
            var imgData = canvas.toDataURL(
              'image/png');
  
            pdf.addImage(imgData, 'PNG', 20, 300);
            pdf.save('Test.pdf');
          }
        });
        // dispose: object with X, Y of the last line add to the PDF 
        // this allow the insertion of new lines after html
        // pdf.save('Test.pdf');
      },
      margins
    );
    $('#listAreaPDF').css(&quot;display&quot;, &quot;none&quot;);
  }
  &lt;/script&gt;
  </code></pre>
  <p><a href="https://stackoverflow.com/questions/23035858/export-html-table-to-pdf-using-jspdf">Credit for the code found here.</a> With few small changes to suit my application, I have added a connection to html2canvas to lift an image out of my application and placing it into the PDF. Which actually works OK - in Safari and Firefox.</p>
  <p>When clicking and activating this function in Chrome I dont even recieve a blank PDF, I get nothing. Not even a pop-up or page generated.</p>
  <p><strong>What might be the reason Firefox&amp;Safari works but not Chrome?</strong>
  I have not yet tried Internet Explorer, but I'm not holding my breath.
  Should you know a way for that to work I'm all for it.</p>
  <p>Cheers for any help or suggestions you might provide.</p>