title: Angular 5 save/load pdf with base64
body: <p>I'm using angular 5 and trying to save/load pdf files.</p>
  
  <p>1.) I save the entire raw base64 string. It looks like the fileBase64 var below. Is that ok?</p>
  
  <p>2.) Then when trying to load the pdf I do the below code. My question is what goes in the Blob() array? I was putting the entire base64 string, but that does not work? help!</p>
  
  <p>I have the following ts code in my controller:</p>
  
  <pre><code>downloadPDF(file: any) {
  
       var fileBase64 = "data:application/pdf;base64,JVBERi0xLjUNCiW1tbW1DQoxIDAg";
  
       var tab = window.open();
       var data = new Blob([fileBase64], { type: 'application/pdf', });
       var fileUrl = URL.createObjectURL(data);
       tab.location.href = fileUrl;     
  }
  </code></pre>