title: Angular how to get file from API
body: <p>I have API that returns PDF file, but in Angular when I call it it gives me this error</p>
  <pre><code>Http failure during parsing for http://localhost:1234/hebaback/public/api/download-report-20
  error: SyntaxError: Unexpected token % in JSON at position 0 at JSON.parse (&lt;anonymous&gt;) at XMLHtt…, text: '%PDF-1.3\n%�߬�\n3 0 obj\n&lt;&lt;/Type /Page\n/Parent 1 0 R\n…1728F9DC34CF5EC66FE&gt; ]\n&gt;&gt;\nstartxref\n2887591\n%%EOF'
  </code></pre>
  <p>the function is simple</p>
  <pre><code>downloadReport(id: any): Observable&lt;any&gt; {
      return this._HttpClient.get(`http://localhost:1234/hebaback/public/api/download-report-${id}`)
  }
  </code></pre>
  <p>I am sure that the error is from angular because I tried the API in postman and it works well</p>