Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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