All PDF files contain a media box for each page, giving the dimensions of the paper. To change these dimensions (without altering the page contents in any way), use the -mediabox option.
cpdf -mediabox "0pt 0pt 500pt 500pt" in.pdf -o out.pdf
Set the media box to 500 points square.
The four numbers are minimum x, minimum y, width, height. x coordinates increase to the right, y coordinates increase upwards. PDF file can also optionally contain a crop box for each page, defining to what extent the page is cropped before being displayed or printed. A crop box can be set, changed and removed, without affecting the underlying media box. To set or change the crop box use -crop. To remove any existing crop box, use -remove-crop.
cpdf -crop "0pt 0pt 200mm 200mm" in.pdf -o out.pdf
Crop pages to the bottom left 200-millimeter square of the page.
cpdf -remove-crop in.pdf -o out.pdf
Remove cropping.
Note that the crop box is only obeyed in some viewers.
cpdf -frombox <boxname> -tobox <boxname> [-mediabox-if-missing]
in.pdf [<range>] -o out.pdf
Copy the contents of one box to another.
This operation copies the contents of one box (Media box, Crop box, Trim box etc.) to another. If -mediabox-if-missing is added, the media box will be substituted when the ’from’ box is not set for a given page. For example
cpdf -frombox /TrimBox -tobox /CropBox in.pdf -o out.pdf
copies the Trim Box of each page to the Crop Box of each page. The possible boxes are /MediaBox, /CropBox, /BleedBox, /TrimBox, /ArtBox.