I have also run into this situation.
As answered in XMLHttpRequest to open PDF in browser
"It is not possible to do via xhr if the URL you are querying actually returns the PDF data."
See the link for the explanation.
What I did was saving the generate pdf on the server and put its name in a cookie.
When receiving the response, I verified that it is a pdf (by checking if resp.headers('Content-Type')=='application/pdf'
).
Then I called a different url which rendered the pdf by using window.open. The second argument ('_self') is used so that no new tab eill be open.
if (isPDF(response))
{
var url=$cookies['fileurl'].substring(1,$cookies['fileurl'].length-1);
$window.open('/ws/print?action='+url,'_self');
delete $cookies['fileurl'];
return;
}