LSAC, the Law School Admission Council, distributes PDF files with busted margins.
Instead of half inch margins all around the page,
they have a one inch margin at the top and no margin at the bottom
(i.e., text runs flush with the bottom of the page).
After spending a few hours trying different poorly documented CUPS command invokations,
I finally found the
It was such a frustrating experience,
I have decided to document the solution in hopes of preventing at least one other person from the same hell.
So first I ran
pdfinfo on the file to get the page size:
1234567891011121314 $ pdfinfo recommend.pdfTitle:Author: DZSCreator: Toolkit http://www.activepdf.comProducer: Toolkit http://www.activepdf.comCreationDate: Mon Oct 16 03:22:47 2006ModDate: Mon Oct 16 03:22:47 2006Tagged: noPages: 1Encrypted: noPage size: 612 x 792 pts (letter)File size: 122713 bytesOptimized: noPDF version: 1.5
So the page is 612 by 792.
Next we run
pdfcrop to produce a file without any margins:
123 $ pdfcrop recommend.pdf recommend-cropped.pdfPDFCROP 1.5, 2004/06/24 - Copyright (c) 2002, 2004 by Heiko Oberdiek.==> 1 pages written on `recommend-cropped.pdf'.
pdfinfo on the resulting file:
1234567891011 $ pdfinfo recommend-cropped.pdfCreator: TeXProducer: pdfeTeX-1.21aCreationDate: Tue Oct 17 00:50:47 2006Tagged: noPages: 1Encrypted: noPage size: 551 x 716 ptsFile size: 110258 bytesOptimized: noPDF version: 1.4
Notice that the page size has shrunk from 612 by 792 to 551 by 716.
So 612 – 551 = 61 pts narrower,
and 792 – 716 = 76 pts shorter.
We can now use this knowledge along with
to recenter the resulting document:
123 $ pdfcrop --margins "31 38 30 38" recommend.pdf recommend-fixed.pdfPDFCROP 1.5, 2004/06/24 - Copyright (c) 2002, 2004 by Heiko Oberdiek.==> 1 pages written on `recommend-fixed.pdf'.
You have successfully compensated for the incompetence of the institution that holds complete control over who can practice US law.
From: Fixing PDF margins