next up previous contents index
Next: Encryption and Decryption Up: Pages Previous: Flipping Pages   Contents   Index


Cropping

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.
\begin{framed}
\small\verb!cpdf -mediabox ''0 0 500pt 500pt'' in.pdf -o out.pdf...
...
\vspace{2.5mm}
\noindent Set the media box to 500 points square.
\end{framed}
The four numbers are minimum x, minimum y, maximum x, maximum y. 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.
\begin{framed}
\small\verb!cpdf -crop ''0 0 200mm 200mm'' in.pdf -o out.pdf!
\p...
...in.pdf -o out.pdf!
\par
\vspace{2.5mm}
\noindent Remove cropping.
\end{framed}
Note that the crop box is only obeyed in some viewers.



root 2008-12-01