title: Displaying pdf from arraybuffer
body: <p>I am returning stream data from laravel dompdf from this code </p>
  
  <pre><code> $pdf = \App::make('dompdf.wrapper');
   $pdf-&gt;loadHTML("&lt;div&gt;This is test&lt;/div&gt;");
   return $pdf-&gt;stream();
  </code></pre>
  
  <p>And this is my JS ajax code</p>
  
  <pre><code>    $.ajax({
          type:"GET",
          url: "/display",
          responseType: 'arraybuffer'
      }).done(function( response ) {
          var blob = new Blob([response.data], {type: 'application/pdf'});
          var pdfurl = window.URL.createObjectURL(blob)+"#view=FitW";
          $("#pdfviewer").attr("data",pdfurl);
      });
  </code></pre>
  
  <p>Here is HTML to display pdf after ajax </p>
  
  <pre><code>&lt;object id="pdfviewer" data="/files/sample.pdf" type="application/pdf" style="width:100%;height:500px;"&gt;&lt;/object&gt;
  </code></pre>
  
  <p>I am getting below error</p>
  
  <blockquote>
    <p>Failed to load PDF document</p>
  </blockquote>
  
  <p>Please help to fix this. How to display pdf file.</p>