bauhausjs / phantom-html2pdf

Node module to generate PDFs from HTML via PhantomJS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting error on live server

msankar1991 opened this issue · comments

Node version: 6.10.0
npm version: 4.4.1

Getting error centos server for this error

{ Error: Command failed: /var/www/delivery_app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs /var/www/delivery_app/node_modules/phantom-html2pdf/lib/phantom-script.js /tmp/tmp-267147QAFKz1Hjrus.html /tmp/tmp-26714AMgpogyzlj9s.pdf   nofile A4 portrait 1cm false false 500
/var/www/delivery_app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory

   at ChildProcess.exithandler (child_process.js:198:12)
   at emitTwo (events.js:106:13)
   at ChildProcess.emit (events.js:191:7)
   at maybeClose (internal/child_process.js:920:16)
   at Socket.<anonymous> (internal/child_process.js:351:11)
   at emitOne (events.js:96:13)
   at Socket.emit (events.js:188:7)
   at Pipe._handle.close [as _onclose] (net.js:497:12)
 killed: false,
 code: 127,
 signal: null,
 cmd: '/var/www/delivery_app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs /var/www/delivery_app/node_modules/phantom-html2pdf/lib/phantom-script.js /tmp/tmp-267147QAFKz1Hjrus.html /tmp/tmp-26714AMgpogyzlj9s.pdf   nofile A4 portrait 1cm false false 500 ' }

Seems like a file of phantomjs is missing.

Have you installed PhantomJS correctly?

Yes its installed correctly. In package.json file also its available

After a little Google search for `` it seems like the package libfontconfig is missing at your OS.

Try this: sudo apt-get install libfontconfig.

Some other results:
uncss/uncss#165
https://stackoverflow.com/questions/45153363/installing-phantomjs-in-centos
ariya/phantomjs#10904
https://stackoverflow.com/questions/45129742/error-while-loading-shared-libraries-libfontconfig-so-1-on-cent-os

This is no issue from phantom-html2pdf.