• Case-insensitive search of a string in a PDF, thanks to pdfgrep  :

    1$ pdfgrep --page-number --ignore-case 'my_string' ./document.pdf
    
  • Convert a PDF to a JPEG file at 150 dpi:

    1$ convert -density 150 ./document.pdf ./document.jpg
    
  • Extract images from a PDF document:

    1$ pdfimages -j document.pdf prefix
    
  • Compile all JPEG files in the current folder into a single PDF at 150 dpi:

    1$ convert -density 150 ./*.jpg ./document.pdf
    
  • Remove password of a PDF:

    1$ pdftk ./password-protected.pdf input_pw PROMPT output ./no-password.pdf
    
  • Split a PDF into pages:

    1$ pdftk doc.pdf burst
    
  • Merge 2 PDF documents:

    1$ pdftk doc1.pdf doc2.pdf cat output newdoc.pdf
    
  • Same as above, but for all PDFs of the current folder. This also have the nice side effect of removing all DRMs :) :

    1$ gs -sDEVICE=pdfwrite -dBATCH -dNOPAUSE -q -sOutputFile=bigfile.pdf ./*
    
  • Reduce size of PDF (see GhostScript -dPDFSETTINGS documentation  ):

    1$ gs -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -q -o small-output.pdf large-input.pdf
    
  • Reduce a big.pdf file to a smaller.pdf file by limiting its images to 1000 pixels and convert them to grayscale:

    1$ pdfimages -j ./big.pdf prefix
    2$ convert -resize 1000x1000 -type Grayscale -density 150 ./prefix-*.jpg ./smaller.pdf
    3$ rm prefix-*.jpg
    

Additional References