Table of Content
1) install wkhtmltopdf on windows7
https://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_mingw-w64-cross-win64.exe
2) make wkhtmltopdf portable
move to $PORTABLEPATH/wkhtmltopdf/
add lines to /etc/profile.d/portabledevops.sh
# portable wkhtmltopdf if [ -d $PORTABLEPATH/wkhtmltopdf ]; then export PATH=$PORTABLEPATH/wkhtmltopdf:$PORTABLEPATH/wkhtmltopdf/bin:$PATH fi
3) remedy for pre tag text wrap
which apply for code, config, table etc
add pre-wrap to html
pre{ white-space: pre-wrap; }
4) command line to convert html to pdf
option –disable-smart-shrinking to avoid the font shrinking, o/w pdf font will be very small when there is long line existing.
$ wkhtmltopdf.exe --disable-smart-shrinking --footer-left 'test guide' --footer-right='[page]/[toPage]' 'test.html' test.pdf