Last active
December 20, 2015 01:19
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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