Download as pdf instead of chrome html documetn
Select where you want to save the file to, and it will be saved. This is a Chrome based setting and it will change how Chrome works. You may have a PDF viewer installed on your system. If this PDF viewer is set as the default app for handling all PDF files on your system, it may intercept the file and open it instead. This tends to happen because file defaults are set at an OS level. Check if the PDF viewer you have installed has any setting that you can change that will prevent it from communicating with Chrome, or any other browser you might have installed.
Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 10 years, 4 months ago. Active 1 month ago. Viewed k times. Improve this question. MikeD 4, 1 1 gold badge 23 23 silver badges 39 39 bronze badges. This is to my knowledge not scriptable behavior. Most browsers will have their own settings for the behavior of what to do with specific file types on download.
This question has also been answered here: stackoverflow. Add a comment. Active Oldest Votes. With html5, it is possible now. Set a "download" attr in element. Improve this answer. Sarim Sarim 2, 2 2 gold badges 17 17 silver badges 20 20 bronze badges. You better go with this solution if it's supported.
Here's a way to check if it is if "download" in document. Is there a way one can specify the text for the pdf instead of mentioning file path? I need to create pdf from a div html but I don't wish to open another window,download should be seemless like in this answer.. As right now August , Browser support seems to be enhanced for this feature, see: w3schools. Note that the download attribute is only supported for same-origin requests.
This is only possible with setting a http response header by the server side code. Apache example. Flask example. Unfortunately iOS will still preview and not download pdf files even if the content disposition is 'attachment'. TylerH 20k 55 55 gold badges 68 68 silver badges 89 89 bronze badges. Hmm, it works great when I open the php file directly. Then the redirection works perfectly. You can use Response.
URL window. Prasad Joshi Prasad Joshi 4 4 silver badges 12 12 bronze badges. Without html5 attribute one can achieve this by using php: Create php file named download. Just a heads up that you need to be careful when you are going to do this with URL parameters. Because one could then also call download. To change how Opera treats PDF files in the browser, follow the steps below.
Tip To have PDF files open in the browser again, repeat these steps and select the Preview in Firefox option or Use other option to choose another program. Internet browser help and support. Was this page useful?
0コメント