title: Download pdf file using jquery ajax
body: <p>I want to download a pdf file for jquery ajax response. Ajax response contains pdf file data. I tried this <a href="https://stackoverflow.com/a/27563953/2368833">solution</a>. My code is given below but I always get a blank pdf.</p>
  
  <pre><code>$(document).on('click', '.download-ss-btn', function () {
  
      $.ajax({
          type: "POST",
          url: 'http://127.0.0.1:8080/utils/json/pdfGen',
          data: {
              data: JSON.stringify(jsonData)
          }
  
      }).done(function (data) {
          var blob = new Blob([data]);
          var link = document.createElement('a');
          link.href = window.URL.createObjectURL(blob);
          link.download = "Sample.pdf";
          link.click();
      });
  
  
  });
  </code></pre>