I want that when user clicks on the button, the pdf file gets downloaded. Is it possible? The browser will handle the file download for you, honoring the user's browser preferences. If you need the link to look like a button, you can style it using CSS.
See for example this SO thread. But the user's browser can block the new window from being created. You might want to simply generate a download link:. How are we doing? Please help us improve Stack Overflow. Take our short survey. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Do you need your password?
Submit your solution! When answering a question please: Read the question carefully. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question. Let's work to help developers, not make them feel stupid.
Related Questions. Recommended Articles. Article Contributed By :. Easy Normal Medium Hard Expert. Writing code in comment? Please use ide. Load Comments. What's New. Most popular in JavaScript. Add a comment. Active Oldest Votes. Improve this answer. When using the above answer, just remember to include View and Text inside the Document component. See here for more info: github. Pankaj Upadhyay Pankaj Upadhyay 2, 17 17 silver badges 22 22 bronze badges. Sign up or log in Sign up using Google.
Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown.
0コメント