Active 21 days ago. Viewed k times. I have an action class that generates a PDF. The contentType is set appropriately. Improve this question. Mike Nayn Nayn 3, 8 8 gold badges 37 37 silver badges 47 47 bronze badges. Add a comment. Active Oldest Votes. Improve this answer. Community Bot 1 1 1 silver badge. Mayur Padshala Mayur Padshala 1, 2 2 gold badges 18 18 silver badges 19 19 bronze badges.
Does it work on chrome? I can only see a blank pdf. Yes, it does work on all modern browsers. If you see a blank pdf, try running the ajax url in a new tab. If you get a blank screen there as well, might be a problem with the pdf itself.
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. Georgios Syngouroglou Ijas Ameenudeen Ijas Ameenudeen 8, 3 3 gold badges 38 38 silver badges 50 50 bronze badges.
This plugin just creates a form, and submits it, then removes it from the page. Vpant Vpant 2 2 silver badges 12 12 bronze badges. It can pdf file path xhr. MemZ MemZ 1 1 silver badge 5 5 bronze badges. Ninja Ninja 1, 1 1 gold badge 21 21 silver badges 27 27 bronze badges. Solution was this: Include download.
Jurijs Kastanovs Jurijs Kastanovs 1 1 gold badge 15 15 silver badges 33 33 bronze badges. I spent several hours on the same problem. PDF font won't be loaded correctly. Thank you! JMax This solution worked like a charm. I'm calling a server side script which makes a curl call to a service which fetches the file via curl. This works great as I can drop a loading gif and disable the request link.
Skip straight to downloads. It is the story of the warrior Ajax and takes place after the events of the Iliad and before the end of the Trojan war. After Achilles is killed in battle, the two kings, Agamemnon and Menelaus award his armor to Odysseus.
However, Ajax feels that it should have been given to him and as revenge, decides to kill them. Instead, he is led by Athena into killing the spoils of the Greek army and when he realises what he has done, he is overcome with shame and decides to take his life. This book has 74 pages in the PDF version. This translation by R. Trevelyan was first published in Last week, around 33, people downloaded books from my site - 9 people donated.
I really need your help to keep this site running.
0コメント