4/21/2023 0 Comments How to get pdf file via ajax callThen, when you receive the URL, you could for example do a window.location to redirect the browser to the download. Just pass the generated URL back to the client. ![]() A complete working sample can be downloaded from PdfSampleAjaxCall.zip. Add a new action method named GeneratePDF in HomeController.cs and include the following code sample to create a PDF using C. Location of Files The PDF file are stored in a folder named Files inside the project directory. You can generate a temporary URL to access the PDF file stored on the server, instead of sending it back to the AJAX call. Add a following code in the index.cshtml for open a PDF in new tab or download the PDF using the Ajax Call. I used jsreport for server side for generate reports. The PDF file will be downloaded as BLOB using jQuery AJAX and XmlHttpRequest (XHR) request and then the file will be downloaded using the Response inside the Success event handler of jQuery AJAX function. ![]() ![]() When a user sends some data to server using ajax call (Here I use 'get' method for make easing the question), it should send pdf to the client side and should show in a pop up window. I'm developing web application using nodejs and jquery.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |