Skip to content

Instantly share code, notes, and snippets.

@lowercasename
Created May 25, 2019 11:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lowercasename/31342fadfc2a5cf608275d1097e23764 to your computer and use it in GitHub Desktop.
Save lowercasename/31342fadfc2a5cf608275d1097e23764 to your computer and use it in GitHub Desktop.
A Bash script to create print-ready tiny zines from 16-page PDF files
#!/bin/bash
if [ -z "$1" ]
then
echo "Please specify an input PDF file ('tinyzine input.pdf')."; exit 1;
else
# Check if pdfTeX is installed
command -v pdftex >/dev/null 2>&1 || { echo >&2 "I require pdfTeX to be installed but I can't find it! Aborting."; exit 1; }
# Check if PDFjam is installed
command -v pdfjam >/dev/null 2>&1 || { echo >&2 "I require PDFjam to be installed but I can't find it! Aborting."; exit 1; }
filename="${1%.*}"
pdfjam --nup 4x4 --a4paper --landscape $1 '8,9,6,11,4,13,2,15,8,9,6,11,4,13,2,15,12,5,10,7,16,1,14,3,12,5,10,7,16,1,14,3' -o $filename-16-up.pdf
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment