title: JS PDF Blob empty page
body: <p>I'm using external Rest API to get spedition label for package. In response I have:</p>
  
  <pre><code>%PDF-1.4\n%����\n6 0 obj\n&lt;&lt;/ColorSpace[/Indexed/DeviceRGB 255(\0\0\0 [...]
  </code></pre>
  
  <p>Now I need to display PDF in browser</p>
  
  <pre><code>var xhr = new XMLHttpRequest();
      xhr.open('POST', '/Order/CreateShipmentInpost', true);
      xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
      xhr.responseType = 'arraybuffer';
      xhr.onload = function (e) {
          if (this.status == 200) {
              var blob = new Blob([this.response], { type: "application/pdf" });
              var link = document.createElement('a');
              link.href = window.URL.createObjectURL(blob);
              link.download = "Report.pdf";
              link.click();
          }
      };
      xhr.send($.param(data));
  </code></pre>
  
  <p>In generated PDF file is only blank page. I don't know why content is not showing.</p>
  
  <p><a href="https://i.stack.imgur.com/XMvhI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XMvhI.png" alt="PDF empty page"></a></p>
  
  <p>I'm using <code>responseType = 'arraybuffer'</code>. Controller returns:</p>
  
  <pre><code> return File(Encoding.UTF8.GetBytes(data, MediaTypeNames.Application.Pdf);
  </code></pre>
  
  <p>I also tried to return json or string, but PDF was always empty.</p>