Trim page marginsPassed
Cut 15mm off every side of the pages of paper.pdf and save the result as tight.pdf.
deft pdf crop paper.pdf --margin 15mm -o tight.pdf
Automatic checks (1)
- python: code = "import subprocess\nfrom PIL import Image\nsubprocess.check_call(['gs', '-q', '-dSAFER', '-dBATCH', '-dNOPAUSE', '-dUseCropBox', '-sDEVICE=png16m', '-r72', '-dFirstPage=1', '-dLastPage=1', '-sOutputFile=page.png', 'tight.pdf'])\nw, h = Image.open('page.png').size\nassert abs(w - 527) <= 3 and abs(h - 707) <= 3, (w, h)\n"






