C using Syncfusion. Pdf; using Syncfusion. Graphics; using System. Imports Syncfusion. Pdf Imports Syncfusion. Graphics Imports System. DrawString "Hello world!
ExportAsActionResult "output. Response, HttpReadType. Helvetica, Note: Starting with v Free Trial. Did you find this information helpful? I agree to the creation of a Syncfusion account in my name and to be contacted regarding this message.
I declare, I accept the site's Privacy Policy. Add Comment. Disclaimer : The code samples and API available at www. You are free to use it for commercial as well as non-commercial use at your own risk, but you cannot use it for posting on blogs or other tutorial websites similar to www. All the code samples and API provided by the authors are solely their creation and neither the author nor the site are responsible if it does not work as intended.
I agree to the above terms. Download Required. What our readers say. I call this action through an Ajax call. I tried a few things but nothing worked. This way the parent page will just stay open, if that was your major concern why would you unnecessarily have chosen Ajax for this otherwise?
Besides, there is no way to handle this nicely acynchronously. PDF is not character data. You want to use completely new request for this. This form is appended to the document and posted to the desired URL. Right after that the form is removed again:. If you do see a pdf file there and not in the downloaded file, do let me know on my email. This anchor element actually did not work for me on IE 11, Edge and Firefox.
Show 7 more comments. BalusC BalusC 1. Once again: you do not need Ajax for this. It's only asking for trouble. In some browsers the window. So, also do NOT use window. If the content-disposition is set to attachment , you will just get a Save as dialogue. The parent page will stay unchanged. There is a limited Url length. And the author is asking about POST. Show 10 more comments. URL window. It is reusable. Hope that helps. Georgios Syngouroglou Georgios Syngouroglou I had to set the responseType of xhr to arraybuffer or blob for this to work.
Otherwise, this works great. I had the exact same question. All the people responding "just make it a link" doesn't help the OP. If your content is dynamic and the link you are going to is dynamic, you have to jquery it all Works great. This is a great answer, but for some reason, I just keep getting broken empty PDF. Can't figure it out. I use FileResult response type: File bytes, System. Octet, fileName ; — Jurijs Kastanovs. Clarification: if open the URL through address bar - file is correctly opened.
Show 1 more comment. ParPar ParPar 6, 7 7 gold badges 42 42 silver badges 53 53 bronze badges. This works for me perfectly at the time of this comment and newest Chrome — Loredra L. You could use this plugin which creates a form, and submits it, then removes it from the page.
0コメント