Hi Ken,
Please follow recommendations that Alena gave you. For example: in Alena's code there is no LocalFileSystem object. But you getting error with this object in browser.
If after trying of these recommendation you still stuck with this issue, please share your app with us.
Alena's recommendations below:
Q1 - yes, do all you need. But you should make sure if you connect jspdf correctly.
Run your app in the browser without frame.
Open console. And type there following code:
console.log(jsPDF);
And run this code. Should return a long function. If you have error this means you have problem with including jspdf to your app.
Q2 - you should get this file in the root of the FS. Please try to find here file "test.pdf".
Q3 - to get generated pdf onto the page you should:
ol
liAdd HTML component, set dimensions for it "auto" and "auto"./li
liFill component HTML with following code:
code<iframe width="100%" height="500px" id="pdfOutContainer"></iframe>/code/li
liModify your button click event handler with following code:
precode
console.log("generating pdf...");
var doc = new jsPDF();
doc.text(20, 20, 'HELLO!');
doc.setFont("courier");
doc.setFontType("normal");
doc.text(20, 30, 'This is a PDF document generated using JSPDF.');
doc.text(20, 50, 'YES, Inside of PhoneGap!');
var pdfUriString = doc.output('datauristring');
console.log(pdfUriString);
var pdfOutContainer = jQuery("#pdfOutContainer");
pdfOutContainer.attr("src", pdfUriString);/code/pre/li
/ol
After you clicked on the button you will get your PDF in the browser if it supports.
//Note: this code below cancels generating pdf for save it in the file. To generate file you should use your code.
Regards.