Thursday, May 9, 2024
 Popular · Latest · Hot · Upcoming
130
rated 0 times [  132] [ 2]  / answers: 1 / hits: 33193  / 11 Years ago, mon, december 2, 2013, 12:00:00

When I try and use the save() function for jsPDF it's throwing the following error:



ReferenceError: saveAs is not defined



I'm just trying a very simple example:



var doc = new jsPDF();
doc.text(20, 20, 'Hello world!');
doc.text(20, 30, 'This is client-side Javascript, pumping out a PDF.');
doc.addPage();
doc.text(20, 20, 'Do you like that?');

doc.save('test.pdf');


Anyone have any ideas what's wrong?


More From » jquery

 Answers
0

Found out what the issue was. The saveAs function is part of FileSaver.js so I just needed to include this and everything worked.


[#73937] Sunday, December 1, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mireyag

Total Points: 73
Total Questions: 107
Total Answers: 85

Location: Ukraine
Member since Sun, Dec 13, 2020
3 Years ago
mireyag questions
Sun, Aug 15, 21, 00:00, 3 Years ago
Wed, Dec 16, 20, 00:00, 3 Years ago
Tue, Sep 1, 20, 00:00, 4 Years ago
Sun, Jul 5, 20, 00:00, 4 Years ago
;