title: Display pdf in a new tab with custom filename
body: <p>I am reading a pdf in the server (SpringBoot) and return it as a byte array to be opened in a new tab. On the client-side (Angular) I am consuming it as a blob. I am then trying to open the pdf in a new tab</p>
  <p><strong>service.ts</strong> file</p>
  <pre><code>getPdf(httpHeaders: HttpHeaders): Observable&lt;any&gt; {
      return this.http.get(this.getServerUrl() + 'dummypdf', {
          observe: 'response',
          responseType: 'blob',
          headers: httpHeaders
      });
  }
  </code></pre>
  <p><strong>Component.ts</strong> file</p>
  <pre><code>openPdf(){
      this.service.getPdf(generateRequestId()).subscribe(file =&gt; {
          let blobData = new Blob([file.body], {
              type: 'application/pdf'
          });
          let fileData = new File([file.body], &quot;name&quot;, {type: 'application/pdf'});
          let fileURL = window.URL.createObjectURL(fileData);
          window.open(fileURL,&quot;_blank&quot;)
      })
  }
  </code></pre>
  <p>I am able to open the pdf in the new tab. Everything is fine. But the blob URL appears as such</p>
  <pre><code>blob:http://localhost:4200/ba35a67c-571e-4450-bda4-b438dc8d6d8e 
  </code></pre>
  <p>I do understand that it is because of the memory location from where it is reading and also it is not customizable.</p>
  <p><strong>My question is, Is there any alternative approach to this. Like perhaps not consume it as a blob or not sending it as a byte array from the server?</strong></p>