Using wkhtmltopdf to create pdfs

Writeup source files can be used to automatically create pdfs using the very useful tool: wkhtmltopdf
This can be installed in a Debian-based system (such as Ubuntu) with:
sudo apt-get install wkhtmltopdf
It is now possible to convert a writeup file to a pdf in two automated steps:
writeup myfile
wkhtmltopdf -s Letter -L 20 -R 20 -T 15 --zoom 1.2 myfile.html myfile.pdf

Options:

  • -s Letter - paper size
  • -L 20 - Left margin 20mm (ditto for R T and B)
  • --zoom 1.2 - enlargement factor
  • --help - see help or man page for more information