Open santhosh12992 opened 7 years ago
I'm having the same probably. The html is valid but no PDF generated and no errors. The interesting thing is that seems like it just stops as soon as my template content reached a certain length.
Hi @santhosh12992 , have you ever figured out this problem?
@yingliangzhang , No i didn't. I am not using protractor now.
Hi,
I am looking to convert the HTML file created by Jasmine2html reports to PDF format. The Code i have used is pasted below. onPrepare: function() { jasmine.getEnv().addReporter( new Jasmine2HtmlReporter({ savePath: 'target/' }) );
}, onComplete: function() { var fs = require('fs'); var pdf = require('html-pdf'); var html = fs.readFileSync('D:/Protractor/Grunt_Pro/target/htmlReport.html', 'utf8'); var options = { format: 'Letter' }; pdf.create(html, options).toFile('D:/Protractor/Grunt_Pro/target/Success.pdf', function(err, res) { if (err) return console.log(err); console.log(res); // { filename: '/app/businesscard.pdf' } }); }
I have user the pdf code in oncompletion block.