how to open a save as popup window on click of generatePDF button to save pdf at local drive.i am using jspdf and auto table js to export html table data to pdf.
Asked
Active
Viewed 1,359 times
0
-
I really doubt you will get a lot of help until you provide some example code and explain what you have tried so far – Jeff Feb 03 '16 at 08:06
-
not able to paste complete code,how to do so... please help – Manish kumar Feb 03 '16 at 11:24
1 Answers
1
According to this answer there is no way to force modern browsers to open a save as dialog. Which I am personally happy about as a user. Some people have had luck with using window.open('file.txt');
, but that only opens a new tab in chrome.
I would advise you to rethink if you have to give the user a save as dialog or if there is another way to handle it. Maybe it is enough asking them what filename they want to use and then use the default way to save a pdf in jspdf:
var filename = document.getElementById('filename-input').textContent;
jspdfDocument.save(filename);

Community
- 1
- 1

Simon Bengtsson
- 7,573
- 3
- 58
- 87