title: Save PDF from window.print in Javascript
body: <p>Good day,</p>
  
  <p>I'm able to print a page using javascript. Using this codes:</p>
  
  <pre><code>var win = window.open('', 'print', 'height=720,width=300');
  ...
  
  win.document.write(document.getElementById("myDivToPrint").innerHTML);
  
  win.document.close(); 
  win.focus();
  win.print();
  </code></pre>
  
  <p>But my problem is, is there a way to save this on my server api? 
  I tried this,</p>
  
  <pre><code>var myPdf = win.output(); // Doesn't work, not found
  </code></pre>
  
  <p>I want to get at least the encoding of the pdf to be able to save it on my server. Is it possible? if yes, please help me how.</p>