Skip to content

Instantly share code, notes, and snippets.

@algal
Created July 15, 2020 01:44
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 algal/dffb48ce09740dbc3b5cd92384669781 to your computer and use it in GitHub Desktop.
Save algal/dffb48ce09740dbc3b5cd92384669781 to your computer and use it in GitHub Desktop.
Add wide margins to a PDF for annotations
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "usage: $0 PDF_filename..."
echo
echo "This script takes a PDF file as command line arguments,"
echo "and generates a new, landscape-formatted PDF file, where every "
echo "page has very large margins which may be useful for editorial notes"
echo
echo "Requires: pdfjam"
echo
echo "Install pdfjam on ubuntu 18.04"
echo " sudo apt intsll texlive-extra-utils"
echo
echo "Install pdfjam and basic latex on macOS:"
echo " brew cask install basictex"
echo " brew tap FLEWID-AB/homebrew-pdfjam"
echo " brew install pdfjam"
exit 1
fi
command -v pdfjam >/dev/null 2>&1 || { echo >&2 "I require pdfjam but it's not installed. Do an apt install of texlive-extra-utils to get it on Ubuntu. Aborting."; exit 1; }
exec pdfjam --batch --nup 1x1 --suffix widemargin --landscape "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment