PDF Tools
Convert pdf to jpg (maximum quality)
gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=jpeg -r150 -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -dMaxStripSize=8192 -sOutputFile=sample_%d.jpg sample.pdf
Merging and deleting pages from PDF documents
To merge two documents you may use a simple command pdftk 1.pdf 2.pdf cat output newfile.pdf
and to delete pages, just type pdftk A=1.pdf cat A4-6 output newfile.pdf
. This will only include page 4-6 in the new document. Have a look at the pdftk website for more examples.
For a GTK environment you can use PDF-Shuffler.
Scanning to pdf directly
You can use gscan2pdf
or simple-scan
Convert multiple image files to PDF
convert -limit memory 64 -limit map 128 -density 150 -compress jpeg -quality 85 *.JPG output.pdf
NOTE: limit memory
and limit map
arguments force imagemagick to use less memory.
Convert multiple PDF files into lower resolution/quality
ls *.pdf | xargs -I {} convert -density 150 -compress jpeg -quality 90 {} ./new/{}
or
ls *.pdf | xargs -I {} convert -density 150 -compress jpeg -quality 90 {} new.{}
Removing a password from a PDF
qpdf --password=Password_here --decrypt locked.pdf unlocked.pdf
Unlocking pdf
qpdf --decrypt encrypted.pdf unencrypted.pdf