Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

How to convert current window result to pdf using titanium alloy?

$
0
0

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);

}


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>