Search code examples
node.jswindows-serviceswkhtmltopdf

wkhtmltopdf as node module fails when run as windows service


I am running a node app that uses the wkhtmltopdf module (https://www.npmjs.com/package/wkhtmltopdf) and node routing to return a pdf of a page when the user navigates to a /pdf path. Everything works fine when the app is run on in the servers console, but when the app runs as a Windows service, the pdf call fails. I get the browser crash screen with the message that the site refused to connect. The rest of the site works fine, just the path to return PDFs fails, and I can't glean anything from the logs. Is this a known issue with wkhtmltopdf?


Solution

  • OS: Fedora I had the issue with my node server program and wkhtmltopdf module in it, not generating pdf when run as a service. Turns out that a user for the service was set as nobody and so was usergroup. We removed that entry and reran the service it works.

    I am guessing this could be the issue with Windows as well.

    Please let me know if it did not work, did work or you already solved the problem with another approach.