Skip to content

Instantly share code, notes, and snippets.

@pakoito
Last active February 26, 2021 18:25
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 pakoito/47f3f007c748603ad498bf130759f8bd to your computer and use it in GitHub Desktop.
Save pakoito/47f3f007c748603ad498bf130759f8bd to your computer and use it in GitHub Desktop.
pdfx() {
name=$(basename $3 .pdf)
for i in {0..$(expr $(vipsheader -f pdf-n_pages $3) - 1)}; do
noglob vips copy $3[dpi=$1,page=$i] $(realpath $2)/$name-$(expr $i + 1)@$1.jpg;
done
}
# cmd dpi outdir infile
# pdfx 300 ./out mypdf.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment