How to crop PDF margins using pdftk and /MediaBox
问题 I used pdftk to uncompress a PDF and then opened it as a text file. I want to edit the /MediaBox field, which is in my case /MediaBox [0 0 612 792] I would like to reduce the margins, for instance /MediaBox [100 0 512 792] Unfortunately it doesn't work. I can change the 0 into a 2 or a 9 but I cannot put 100 for instance. Any idea why? 回答1: use sed to replace any occurrence sed 's/MediaBox \[0 0 612 792*/MediaBox \[100 0 512 792]/g'<in.pdf >out.pdf or podofobox (inside podofo utils ) http:/