0

I am trying to download pdf file generated by itext.

In my application, jquery, rest web service is being used.

As of now, i am able to create pdf file at server side but facing issue while sending to html.

I have tried below links with no success.

iTextSharp generated PDF: How to send the pdf to the client and add a prompt?

Download pdf file using jquery ajax

When i see in developer tool, i can see below data in response of ajax request.

Block quote%PDF-1.4 %���� 3 0 obj <>stream x���|E� ...

Block quote

Community
  • 1
  • 1
AbhiGawas
  • 1
  • 3
  • duplicate --> http://stackoverflow.com/questions/28165424/download-file-via-jquery-ajax-post – karman Mar 22 '17 at 18:22

1 Answers1

0

Are you creating it in memory or creating a file on server. There are number of methods to do this. Either you can manipulate the headers and pass in the response. Create a file on server and pass the file url in response and open it in new tab. It depends on which language you are doing. Handle file download from ajax post

Content-Type: application/octet-stream
Content-Disposition: attachment; filename="somefile.pdf"
Community
  • 1
  • 1
karman
  • 346
  • 3
  • 20