3.2 Scale Pages

The -scale-page operation scales each page in the range by the X and Y factors given. This scales both the page contents, and the page size itself. It also scales any Crop Box and other boxes (Art Box, Trim Box etc). As with several of these commands, remember to take into account any page rotation when considering what the X and Y axes relate to.

cpdf -scale-page "2 2" in.pdf -o out.pdf

Convert an A4 page to A3, for instance.

The -scale-to-fit operation scales each page in the range to fit a given page size, preserving aspect ratio and centering the result.

cpdf -scale-to-fit "297mm 210mm" in.pdf -o out.pdf cpdf -scale-to-fit a4portrait in.pdf -o out.pdf

Scale a file’s pages to fit A4 portrait.

The scale can optionally be set to a percentage of the available area, instead of filling it.

cpdf -scale-to-fit a4portrait -scale-to-fit-scale 0.9 in.pdf -o out.pdf

Scale a file’s pages to fit A4 portrait, scaling the page 90% of its possible size.

The -scale-contents operation scales the contents about the center of the crop box (or, if absent, the media box), leaving the page dimensions (boxes) unchanged.

cpdf -scale-contents 0.5 in.pdf -o out.pdf

Scale a file’s contents on all pages to 50% of its original dimensions.

To scale about a point other than the center, see the positioning commands described in §8.2.