title: Angular FileSaver with blob and WebAPI . PDF downloaded is blank. But API url returns PDF with content
body: <p>This is my API for returning a PDF with multiple images . Now when I invoke this with url it perfectly downloads the PDF with images . For eg two pages with images .</p>
  
  <pre><code> [HttpGet]
  
      public async Task&lt;IHttpActionResult&gt; Download(Guid customDocId)
      {
  
                      byte[] responseContent = await Task.FromResult(FileNetApiClientFactory.Get(customDocId).DownloadDocument(customDocId, "pdf", true));
                      HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK)
                      {
                          Content = new ByteArrayContent(responseContent),
                          StatusCode = HttpStatusCode.OK,
                      };
                      response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment") { FileName = string.Concat(customDocId.ToString(), ".pdf") };
                      response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/pdf");
                      return ResponseMessage(response);
  
              }
  </code></pre>
  
  <p>Now from angular I am using blob and <code>FileSaver</code> for saving the PDF . So when I download it . Then it  just returns two pages but with no content . But it shows page 1 and page2 but they are blank .</p>
  
  <p>Here is my angular code :</p>
  
  <pre><code> //saveAs method is from FileSaver.js
          vm.download = function () {
              documentService.download($scope.customDocumentId).then(function (fileData) {
                  var blob = new Blob([fileData], { type: 'application/pdf' });
                  saveAs(blob, $scope.customDocumentId + ".pdf");
              }).catch(function () {
  
              });
          }
  </code></pre>
  
  <p>And the service : </p>
  
  <pre><code>function _download(customDocumentId) {
              return Restangular
                  .one('customdocument', customDocumentId).one('download')
                  .get(null, { responseType: 'arraybuffer' });
          }
  </code></pre>
  
  <p>Does anyone has any idea why is it returning the blank pages when saved with FileSaver, while with direct download it is perfectly fine with all content.</p>