Skip to content

Instantly share code, notes, and snippets.

@igorbrigadir
Created February 18, 2020 11:30
Show Gist options
  • Save igorbrigadir/09ac67b8a3dc617c58b5f7609b3fa7ed to your computer and use it in GitHub Desktop.
Save igorbrigadir/09ac67b8a3dc617c58b5f7609b3fa7ed to your computer and use it in GitHub Desktop.
Printing Booklet Papers with pdfbook
#!/bin/bash
# Parse file name (can sometimes break with strange names but works with most)
FILE="$(basename $1 .pdf)"
# Bookletize
pdfbook $FILE".pdf"
# Launch pdf viewer of your choice to preview and print
evince $FILE"-book.pdf"
# Remove temporarily created files after veiwer is closed
rm $FILE"-book.pdf"
#!/bin/bash
# Parse file name (can sometimes break with strange names but works with most)
FILE="$(basename $1 .pdf)"
# Trim white space: left bottom right top
pdfjam --trim '1.5cm 1.5cm 1.5cm 1.5cm' --clip true $FILE".pdf" --outfile $FILE"trim.pdf"
# Bookletize
pdfbook $FILE"trim.pdf"
# Launch pdf viewer of your choice to preview and print
evince $FILE"trim-book.pdf"
# Remove temporarily created files after veiwer is closed
rm $FILE"trim-book.pdf"
rm $FILE"trim.pdf"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment