title: pdfMake - open() and print() functions are not working
body: <p>I'm trying to learn how to use <strong>pdfMake</strong>. I'm trying to use <code>open</code> and <code>print</code> to generate or print the information respectively. But, when I click on the button which fires the event, a new tab opens for a second and vanishes. 
  The page which opens is displayed in history as <code>blob:http://localhost:9999/93c1600e-3c64-42fe-8b44-fe6eeb995b5e</code></p>
  
  <p>I'm not able to figure out the error. I'm following the official <a href="https://www.npmjs.com/package/pdfmake#building-from-sources" rel="noreferrer">documentation</a> of pdfMake.</p>
  
  <p>Please help.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function print(){
    window.event.preventDefault()
    // this is just a simulation of the open event, replacing it with print produces the same result
    var docDefinition = { content: {text:'This is an sample PDF printed with pdfMake',fontSize:15} };
    pdfMake.createPdf(docDefinition).open();
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE HMTL&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;meta charset="utf-8" /&gt;
    &lt;meta name="viewport" content="width=device-width,initial-scale=1.0" /&gt;
    &lt;script src='https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.27/pdfmake.min.js'&gt;&lt;/script&gt;
    &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.27/vfs_fonts.js"&gt;&lt;/script&gt;
    &lt;script src="js/print.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;main&gt;
      &lt;button onclick="print()"&gt;Print Card&lt;/button&gt;
    &lt;/main&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>