Skip to content

Instantly share code, notes, and snippets.

@brossetti
Created March 22, 2017 15:47
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 brossetti/f557495fc31d37f029e49a658d2440c2 to your computer and use it in GitHub Desktop.
Save brossetti/f557495fc31d37f029e49a658d2440c2 to your computer and use it in GitHub Desktop.
Prints a one-page double-sided preview of all PDFs in a specified directory
#!/bin/bash
# This script prints a one-page double-sided preview of all pdfs in a
# specified directory. It takes two arguments: 1) the name of the
# printer and 2) the directory path. This script does not specify a
# color mode or print quality.
#
# ./print_pdf_preview.sh <printer_name> <dir_path>
for f in $2*.pdf
do
lp -d $1 -P 1-2 -o fit-to-page -o sides=two-sided-long-edge $f
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment