I have a method that returns a pdf
return File(stream, "application/pdf");
I call this method with ajax in the following way
$.ajax({
url: '@Url.Action("HojaDeSalidaPDF")',
data: { 'ID': id },
type: "GET",
contentType: 'application/json; charset=utf-8',
success: function (data) {
//Descargar PDF
},
error: function (xhr, status, thrownError) {
onFailure(xhr, status, thrownError);
}
});
My question is how can I do it so that I can download the pdf?