title: Getting blank pdf from ajax call returning HttpResponseMessage in webapp
body: <p>I am returning HttpResponseMessage from web api and use this in ajax call but getting blank pdf.</p>
  
  <p>my ajax call is</p>
  
  <pre><code>function downloadPDF()
      {
          $.ajax({
              type: "POST",
              crossDomain: true,
              data: JSON.stringify(UserData),
              url: rootUrl + "api/WebAPI/Export",
              //dataType: "native",
              contentType: "application/json",
              //responseType: 'arraybuffer',
              //contentType: "application/pdf",
  
              headers: headers,
              success: function (data) {
                  //document.write(data);
                  alert(data.size);
                  var blob = new Blob([data]);
                  var link = document.createElement('a');
                  link.href = window.URL.createObjectURL(blob);
                  link.download = "Dossier_" + new Date() + ".pdf";
                  link.click();
              }
      }
  </code></pre>