Hello there,
I'm trying to access the end event (using Node) of the convertHtml method in a promise, I tried this:-
var client = new pdf.Pdfcrowd(username, apikey);
client.convertHtml(html, {
pdf: function(rstream) {
rstream.on('end', function() {
pdf.saveToFile(path);
resolve();
});
}
}, a4);
But that doesn't work -- the PDF doesn't get generated (though curiously my API tokens goes down!). Basically, I want to resolve the promise/call a callback when I know the PDF has been generated and saved. Can anyone help?
Many thanks :)