marcbachmann / node-html-pdf

This repo isn't maintained anymore as phantomjs got dreprecated a long time ago. Please migrate to headless chrome/puppeteer.
MIT License
3.56k stars 543 forks source link

Error: html-pdf: PDF generation timeout. Phantom.js script did notexit. #444

Open Afdz1020 opened 6 years ago

Afdz1020 commented 6 years ago

hello

I am trying to print a pdf , but at the moment of processing the data I get the error'html-pdf': PDF generation timeout. Phantom. js script did not exit.', I put a longer timeout on it because I have to process a lot of information, but I always get the same error.

This is my code

var options = { width: '240mm', height:'178mm', "border": { "top": "0", "right": "0", "bottom": "0", "left": "0" }, timeout: 180000 }

pdf.create(html, options).toBuffer(function (err, buffer) { res.status(200).send(buffer.toString('base64'))); });

What can I do, I need help with this.

Thank you very much

ajxs commented 6 years ago

I'm intermittently getting this error. Same process, fails maybe around 25% of the time. Can anyone please advise how to better debug the PhantomJS process?

kmahalingpur commented 6 years ago

I am also facing the same issue. If I increase time out it is working but user cannot wait for that much time.

dqhung215 commented 5 years ago

I am also having the same problem. How to deal with it?