Closed PaddyMann closed 9 years ago
Could you please log what is the actual error?
function generatePdf (url, reply) {
console.log('Rendering', url);
htmlToPdf({
url: url
}, function(err, pdf) {
//add missing error handling
if (err)
console.log(err);
reply(pdf.stream).type('application/pdf');
});
}
Yup apologies - had intended to add that but had a server issue directly after the first post...
The error is:
{ [Error: socket hang up] code: 'ECONNRESET' }
Unfortunately I am out of the office until Sunday, so I cannot try to verify this. The test for url based conversion: https://github.com/pofider/phantom-html-to-pdf/blob/master/test/test.js#L51
phantomjs may need to install some additional packages to work properly on ubuntu, you can try this:
sudo apt-get install build-essential chrpath git-core libssl-dev libfontconfig1-dev
Just a quick heads up - my attention has been diverted onto other areas this week, but I'll be coming back onto this (and items in my other issue threads) next week! Thanks for your help this wk.
Apologies, this was a schoolboy error on my part. Uploaded the node-modules dir rather than rerunning npm install on linux. It's now working!
Now trying to run my server on an AWS instance running ubuntu, and hitting:
Here's my simple server:
Any ideas what could be leading to this issue?
Unlike locally, changing the strategy doesn't seem to make any difference :(