Guest User

Crop and rotate pdf

a guest
Jan 10th, 2012
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.28 KB | None | 0 0
  1. #!/bin/bash
  2. if [ ! $1 ]; then
  3.     exit 1;
  4. fi
  5. mkdir /tmp/pdfconv-$1
  6. convert -density 300 $1 /tmp/pdfconv-$1/part.jpg
  7. for img in /tmp/pdfconv-$1/*.jpg ; do
  8.     convert -rotate 90 -crop 100%x50% $img $img-crop.jpg
  9. done
  10. convert -adjoin /tmp/pdfconv-$1/*-crop-*.jpg $1-cropped.pdf
Advertisement
Add Comment
Please, Sign In to add comment