My current setup: I have a php-generated table which shows some data of some "to-be-generated" pdfs. Each row has a checkbox. The "checked" unique values of the checkboxes are written into an array and are send to the createpdf.php - File.
The plan is to open a new window and put the pdf-File in it.
// put all the checked rows into array (e.g. "101,105,107")
$("#tools_savepdf").click(function(){
arr_id = [];
$('.checkbox').each(function(){
if ( $(this).is(':checked') ){
arr_id[arr_id.length] = $(this).val();
}
});
// open realtime-generated PDF
$.ajax({
type: "POST",
url: "createpdfs.php",
data: { arr_id:arr_id },
async: "true",
success: function(data){
var win = window.open();
win.document.write(data);
} //success
}); //ajax
}); // click
The problem is: The generated PDF is printed to the browser like "%PDF-1.3 3 0 obj <> endobj 4 0 obj <> stream x��W�r�H��+ ...".
I want to have it as file. P.S.: Using mimetype-Parameter in ajax did not help.
Is there a ajaxify-to-file option I don't know?