Skip to content

Instantly share code, notes, and snippets.

@erthalion
Created October 28, 2013 10:33
Show Gist options
  • Save erthalion/7194648 to your computer and use it in GitHub Desktop.
Save erthalion/7194648 to your computer and use it in GitHub Desktop.
# $1 - name of file, that contains urls list
# $2 - name of output pdf file
url_list=$1
output=$2
set -- $(cat $url_list); count=0;
pdf_list=""
for arg;
do
(( ++count ));
echo "Download ${arg}"
wkhtmltopdf ${arg} ${count}.pdf;
pdf_list="$pdf_list ${count}.pdf"
done
echo "Merge $pdf_list into ${output}"
pdfunite $pdf_list $output
rm $pdf_list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment