install wkhtmltopdf and execute it from shell script

Install over ubuntu 14.04

sudo apt-get update
sudo apt-get install xvfb libfontconfig wkhtmltopdf

Test

xvfb-run wkhtmltopdf http://google.com google.pdf

create file gpdf.sh at bin folder

sudo nano /usr/local/vestacp/bin/gpdf.sh

======

#!/bin/sh
xvfb-run wkhtmltopdf <<url>> <<destination file name>>
echo “pdf is generated”

===================

make is self execute ,give permission as below

chmod a+x /usr/local/vestacp/bin/gpdf.sh

open cron editor or UI

  • * *  * * */5 sudo /usr/local/vestacp/bin/gpdf.sh >> ./log.log

Leave a Reply

Your email address will not be published. Required fields are marked *