im creating a service that will transform html to pdf. Request with parameter(HTML code to be transfered into PDF) ist send with ajax post.
On server side generating pdf file is no problem. I was trying to send it back with JSON but i figured out that its not a good idea. So now im sending it back with no changes - full pdf file as it was generated
...
$pdf->Output('out.pdf', 'I');
And here comes the tricky part. What can i do with it on client side? I was trying to show it or download it but i could not figured out how.
$.ajax({
type: 'POST',
url: service_url,
data: out,
success: function (data) {
// WHAT SHOULD I DO WITH "data" IF I WANT TO SHOW IT?
error: function () {
alert("Error");
}
});
Thanks