title: How to download pdf file in angular 2
body: <p>This is function to download pdf file in angular 2 when I am downloading Pdf file it is corrupted file. So how do I solve this problem.
  It is displaying corrupted data like this.
  %PDF-1.5
  %����
  ↵66 0 obj
  &lt;>
  endobj</p>
  
  <pre><code>downloadFile() {
      //this.http.get('https://contactsapi.apispark.net/v1/companies/').subscribe(
      this.http.get('assets/Files/booking.pdf').subscribe(
        (response: any) =&gt; {
          console.log(response);
          let parsedResponse =(response)
          var blob = new Blob([response], {type: 'application/pdf'});
          var filename = 'booking.pdf';
          saveAs(blob, filename);
        });
    }
  </code></pre>