Skip to content

Instantly share code, notes, and snippets.

@infusion
Created August 18, 2015 16:53
Show Gist options
  • Save infusion/cf1d0eed5f02c8c28dd4 to your computer and use it in GitHub Desktop.
Save infusion/cf1d0eed5f02c8c28dd4 to your computer and use it in GitHub Desktop.
Download a website as PDF
#!/bin/bash
function url2pdf {
tmp_file=.tmp.html
res_file=${1//[^A-Za-z0-9.:-]/}.pdf
curl $1 > $tmp_file
cupsfilter -f $tmp_file > $res_file
rm $tmp_file
}
# url2pdf http://www.xarg.org
url2pdf $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment