Skip to content

Instantly share code, notes, and snippets.

Last active Feb 16, 2021
What would you like to do?
join PDFs on macOS from the command line with zero dependencies
if [ "$#" -lt 2 ]; then
echo "usage: $0 output_pdf_path input_path1..."
echo "This script joins the PDFs at input_path1, input_path2, etc."
echo "into one pdf at output_pdf_path"
echo "Known good: macOS 11.1, and below for many versions"
exit 1
script_path="/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/"
command -v "$script_path" >/dev/null 2>&1 || { echo >&2 "I require $script_path but it's not there. macOS has probably changed too much for me to be useful. Aborting."; exit 1; }
exec "$script_path" -o "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment