I want to generate a module which will generate PDF by taking input as my Invoice and that PDF file is send to clients mail id automatic. In 1st step i got some code and try to generate PDF. That code is working fin and i am able to generate the PDF. but i am not able to open the file.
for code i use this link:http://github.com/marak/pdf.js/
Install http://phantomjs.org/ and the install the phantom node module https://github.com/sgentle/phantomjs-node
Here is an example of rendering a pdf
phantom = require('phantom')
phantom.create(function(ph){
ph.createPage(function(page) {
page.open("http://www.google.com", function(status) {
page.render('google.pdf', function(){
console.log('Page Rendered');
ph.exit();
});
});
});
});