title: Using jsPDF to create a PDF from an iframe
body: <p>Ok, I have scoured the internet for a solution to this but I can't find anything. I am trying to find a way to save the contents of an iframe as a PDF. I am always running into an issue where the PDF is just blank. It seems that jsPDF is the only way. I'm kind of wondering if the reason this isn't working is because of the fromHTML() function. I'm not sure. If any of you have figured out a solution I would be very appreciative!!</p>
  
  <p>Here is some sample code you can try in an HTML file:</p>
  
  <pre><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.2/jspdf.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;&lt;/script&gt;
  &lt;script&gt;
      function demoFromHTML() {
      var pdf = new jsPDF('p', 'pt', 'letter');
      source = $('#frame')[0];
      specialElementHandlers = {
          '#bypassme': function (element, renderer) {
              return true
          }
      };
      margins = {
          top: 80,
          bottom: 60,
          left: 40,
          width: 522
      };
      pdf.fromHTML(
      source,
      margins.left,
      margins.top, {
          'width': margins.width,
          'elementHandlers': specialElementHandlers
      },
  
      function (dispose) {
          pdf.save('Test.pdf');
      }, margins);
  }
  &lt;/script&gt;
  &lt;button onclick="javascript:demoFromHTML();"&gt;PDF&lt;/button&gt;
  &lt;iframe id="frame" src='https://wikipedia.org/wiki/Main_Page' style="width: 75%;height: 75%;"&gt;&lt;/iframe&gt;
  </code></pre>