PDFJam

pdftk died. What a pity. That tool was a great improvement with handling PDF files. You could do basically anything you’d like with your files and it was quick. Since the maintenance stopped a while ago it seems that the operating systems simply have grown out of the basic needs of this tool. Modifications haven’t been made since October 2010. Now it’s broken. It feels like you had the perfect screwdriver and suddenly industry comes out with a new type of screws and you don’t even get a simple screw back into the wooden frame.

The next generation tool (or at least an alternative) is called pdfjam It doesn’t seem to have reached the comfort level of pdftk, but life isn’t about comfort either, or is it?

The most common tasks to substitute pdftk would be

  • Merging

    $ pdfjam file1.pdf '-' file2.pdf '1,2' file3.pdf '2-' --outfile output.pdf
    
  • Splitting

    $ pdfjam file1.pdf '1,2' --outfile first.pdf
    $ pdfjam file1.pdf '3-' --outfile second.pdf
    
  • Trimming

    This trims 1cm from the left and right, and 2cm from the top and bottom of the file. This is especially useful for removing blank margins from PDFs (really nice for reading on an e-book reader).

    $ pdfjam --trim '1cm 2cm 1cm 2cm' --clip true file1.pdf --outfile output.pdf
    
  • Upping

    This recombines the pdf file to contain 4 pages per page. Useful for printing slides.

    $ pdfjam --nup 2x2 file1.pdf --outfile output.pdf
    
  • Rotate

    This drops the pages 2 and 3 of file1.pdf into file1.rotated.pdf after the pages have been rotated 180dg. This is basically the command used when running pdf90 (part of the toolkit).

    $ pdfjam file1.pdf 2-3 --suffix rotated --angle '180' --fitpaper 'true' --rotateoversize 'true'
    
  • All other commands and options are explained in detail:

    $ pdfjam --help
    
  • Other tools:

    pdfjam comes with other tools as well. When I had the problem to put two A5 pages on a single A4 sheet, this helped me:

    $ pdfnup a5doc.pdf a5doc.pdf