Hi i need to convert titanium current window data to create pdf file. I am using code given below and am getting error "cannot call method text is undefined".
function downloadpdf() { var doc = require('jspdf');
doc.setFont("helvetica");
doc.setFontType("bold");
doc.setFontSize(24);
doc.text(20, 180, 'Hello world');
doc.text(20, 190, 'This is jsPDF with image support\nusing Titanium..');
doc.addPage();
doc.rect(20, 120, 10, 10); // empty square
doc.rect(40, 120, 10, 10, 'F');
var file = Ti.Filesystem.getFile(Ti.Filesystem.tempDirectory, 'test.pdf');
doc.save(file);
}