Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.