I have a link, and when the user clicks on it, he receives a PDF file. In jQuery, I create an ajax POST call for the server to get a PDF file. The answer is a PDF file with the correct content headers, etc., which usually force the browser to open the Reader plugin or allow the user to save the PDF file. But in my case, this does not work. Is there a way to set the content type of data or set the content type for PDF?
My ajax call:
$('#sf_getpdf').click(function() { $.ajax({
Firebug answer: 
The answer is in the browser ...

I already tried to set the content type on the server without success:

Edit: Ajax is not needed to do this.
<a id="adr_stitok" target="_blank" href="index.php?route=sale/order/superfaktura_getpdf&token=<?php echo $token; ?>&invoice_id=<?php echo $invoice_id; ?>&sf_token=<?php echo $sf_token ?>" >Download</a></td>
Let's do it.
source share