helm/bin/html2pdf

18 lines
507 B
Plaintext
Raw Normal View History

2013-12-19 06:51:09 -08:00
#!/usr/bin/env zsh
2013-12-20 10:17:02 -08:00
# Converts an html file (or website) to a pdf. It installs
# the dependencies if they aren't available.
#
# Note: MAC ONLY!
2013-12-19 06:51:09 -08:00
if ! is_mac; then
echo "Mac-only script!"
exit
elif ! command_exists wkhtmltopdf; then
2013-12-19 07:39:40 -08:00
# wkhtmltopdf > 0.9.9 has a habit of hanging after it completes, so we
# install 0.9.9 explicitly instead.
2013-12-19 07:38:39 -08:00
brew install https://raw.github.com/mxcl/homebrew/6e2d550cf4961129a790bfb0973f8e88704f439d/Library/Formula/wkhtmltopdf.rb
2013-12-19 06:51:09 -08:00
fi
wkhtmltopdf "$1" "$2"