title: generate PDF from window.print() result
body: <p>Is there any way to get and download a pdf from the output of the window.print () command.</p>
  
  <p>For example:</p>
  
  <p>I have a button that launches the window.print () method, this launches a popup of browser print options with print options, and I can select pdf and generate the document correctly.</p>
  
  <p>What I need is that by clicking I download the PDF file automatically.</p>
  
  <p>Is there any way to use the result of windows.print to download the pdf, either combining it with some js library. All on the client side?</p>
  
  <p>thank you.</p>
  
  <p>ok I'll try. The plugin that I use to generate the pdf is datable buttons and exports the table to pdf, all this works fine, but there is a screen print button that also generates a tab with the view to print, the problem is that when using this function in chrome, everything works ok, but it allows me to return to the main view, and the printing tab for this is linked to the main view so no action is allowed in the main view, I would like to block the main view when it opens the printing tab</p>