Skip to content

Instantly share code, notes, and snippets.

@hironow
Last active December 20, 2015 01:19
Show Gist options
  • Save hironow/6047940 to your computer and use it in GitHub Desktop.
Save hironow/6047940 to your computer and use it in GitHub Desktop.
出力されるPDFファイルは連番でURLを並べたファイルを渡して実行します.ブログ: http://hironow.bitbucket.org/blog/html/2013/07/15/url_to_pdf_script.html
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Error: only one input file is allowed"
exit 1
else
echo "Input: $@"
FILE_NUM=1
for URL in `cat $1`
do
wkpdf --source "${URL}" --output "${FILE_NUM}.pdf"
echo "${FILE_NUM}.pdf <- ${URL}"
FILE_NUM=`expr ${FILE_NUM} + 1`
done
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment