Q:

Fix PDF margins for two-sided printing

I have a free PDF book on which every page has a very large margin on the right-side. I would like to print it two-sided and bind it to a book using an online printing service. The problem is that I would need to move the content of each odd numbered page to the right for this to work better.
I don't have access to the TeX source that generated the file and the authors are not providing it, so I can't recompile it for two-sided printing. I'm happy with any solution that works on either Linux or OS X.
For anyone interested, the file is this: http://infolab.stanford.edu/~ullman/mmds/book.pdf
EDIT: After some tinkering I did it with the following method:

I first split the pdf into two files of odd/even pages using pdftk.
Using Skim I measured the size of the left margin which was 72pts.
Using Skim's select tool, I picked a 72pt margin on the left for the odd pages and on the right for the even pages with a total width of 450 points. To keep A4 proportions, I chose 636 pts as the height of the bounding box and made it fit the document. Finally, I cropped the even/odd files to their corresponding boxes.
Merged the files using pdftk.
Open the file in OS X Preview, opened the print dialog, chose save as PDF, chose A4 as paper size and scale to fit the page.

Had been nicer to do this from the command line, since using a calculator to calculate the coordinates is much quicker than trying to get the bounding boxes with the correct coordinates. From some reason Skim doesn't show you the coordinates of the cursor in the status bar before you have chosen the first point for the selection.

A:

Method #1 - pdfcrop
There's a command line tool called pdfcrop that sounds like what you're looking for.

pdfcrop  is  a  utility to calculate and remove empty margins from each
  page in the input PDF file.  The resulting  output  file  occupies  the
  minimal  paper  size  needed for the contents and is therefore suitable
  for inclusion as a graphic

Examples
$ pdfcrop --margins 10 input.pdf output.pdf
$ pdfcrop --margins ’5 10 5 20’ --clip input.pdf output.pdf

Method #2 - pdfjam
As an alternative there's another tool called pdfjam.
$ pdfjam --twoside --offset '2cm 0cm' file.pdf

References

PDFCROP - crop pdf files to their minimal size - man page
PDFcrop project page
Add margin to PDF file when merging using PDFTK or similar

