Skip to content

Instantly share code, notes, and snippets.

@hackingbutlegal
Last active December 15, 2015 03:59
Show Gist options
  • Select an option

  • Save hackingbutlegal/5198754 to your computer and use it in GitHub Desktop.

Select an option

Save hackingbutlegal/5198754 to your computer and use it in GitHub Desktop.
Download files from Issuu
#
# not a script, just a set of cmds
#
printf 'http://image.issuu.com/actual_url/jpg/page_%d.jpg\n' {1..500} > files.txt
wget -i files.txt
# test sed
for filename in page_*.jpg; do echo $filename | sed -e 's/page\_//g'; done
# execute sed rename
for filename in page_*.jpg; do newname=`echo $filename | sed -e 's/page\_//g'`; mv $filename $newname; done
# convert images to pdf
for f in *.jpg; do
convert ./"$f" ./"${f%.jpg}.pdf"
done
# combine pdfs into one file in numerical order
ls | sort -g -o files2.txt
pdftk <file names in desired order> cat output new_file.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment