dotfiles/_custom/.local/lib/pdf_tools.sh

9 lines
247 B
Bash

#!/bin/zsh
function pdf_num_pages {
gs -q -dNOSAFER -dNODISPLAY -c "($1) (r) file runpdfbegin pdfpagecount = quit"
}
function pdf_extract_range {
yes | gs -q -dBATCH -sOutputFile="$4" -dFirstPage=$2 -dLastPage=$3 -sDEVICE=pdfwrite "$1"
}