I hope you set the
-densitycorrect, so that you do not degrade your image during the re-rasterising. However, I think-density 400should come beforepdf.into take an effect.I hope that your pdf file from the corridor scanner is safe, in particular that it is not a Postscript file internally. Also I hope that you have a safe version of
GS(which is called by IM for pdf/ps/... conversions.) link, link. (gs --version≥9.24)Anyway, with regard to the previous two points, for the scanner origniated pdf files I would recommend to start by
pdfimagesprogram to extract the scanned pages. Something like
pdfimages -list in.pdf # show info
rm temporary* # remove temporary files
rm DOcrop* # remove our option files
pdfimages -all in.pdf temporary # -all for natural (original) format
# make your choices; can be done manually by touch program
for x in termporary*; do
gopen "$x" # view the file
echo "File $x: <Enter> for crop, <Ctrl-D> for keep"
read && touch DOcrop-"$x"
done
for x in termporary*; do
[ -e DOcrop-"$x" ] && mogrify -crop 50%x0 +repage "$x"
done
convert temporary* out.pdf # some options?
You can use
convert pdf.in[0-1,7] ...to use just the specified pages. See 7.You can use tools like
pdftk,qpdf,pdfselect+pdfunifyto select and/or reorganise the pagesFor pdfs with vector graphics or text (not good for scanned pags) one can use
pdfcropwhich uses TeXconvertcan have a long command line but I do not know details howcommand line. It seems you will need to use itstack operations if you go this way, something likeconvert in.pdf[0-9] \( in.pdf[10] -crop ... \) ...to make first ten pages non-changed, and eleventh page cropped. Without\( \), cropping operation would be applied on all preceding pages.IM and GM have scripting tools, which I do not konw.