Download generated PDF use FileSaver on client side and Snappy on server side
<p>I try to use FileSaver to download generated PDF from server. However, it's not work.</p>

<p>In Laravel framework, I use Snappy to create PDF file from HTML.</p>

<pre><code>$pdf = \PDF::loadView('pub.view', $data);
//$pdf-&gt;save('myfile.pdf');    //It's saved successfully.
return $pdf-&gt;download('printing.pdf');
</code></pre>

<p>From client, I apply $resource service of AngularJS for getting PDF file.</p>

<pre><code>printPDF: {
            method: 'GET',
            headers: {
                accept: 'application/pdf'
            },
            responseType: 'arraybuffer',
            cache: true,
            transformResponse: function (data) {
                var pdf;
                if (data) {
                    pdf = new Blob([data], {
                        type: 'application/pdf'
                    });
                }
                return {
                    response: pdf
                };
            },
            url:'/u/:id/exportTopdf',
            params:{id:'@id'}
        }
</code></pre>

<p>After server response, FileSaver will save this file. </p>

<pre><code>myService.printPDF({id: myId},
function successCallback(response){    

   saveAs(response, 'filename.pdf');  //FileSaver function

}, function errorCallback(response){

});
</code></pre>

<p>When running, the issue is happen in browser console:</p>

<pre><code>`TypeError: Failed to execute 'createObjectURL' on 'URL': No function was found that matched the signature provided`.
</code></pre>

<p>I think FileSaver makes the problem but I don't know how to fix it.</p>