Adjust margins of PDF pages
Unlike a physical sheet of paper, a PDF page is defined mathematically by five distinct boundary boxes.
When you add margins to a PDF using this tool, we aren't just drawing white rectangles on the edges. Instead, we are mathematically expanding the MediaBox and CropBox coordinates.
If you want the content to stay the same size but have more whitespace around it, we translate (shift) the existing content stream and expand the bounding box dimensions.
If you want to scale the content down to fit within new, larger margins without changing the overall page size, we apply an Affine Transformation Matrix.
This matrix multiplies the coordinates of every path, image, and text block in the page's content stream, uniformly scaling them down and re-centering them on the canvas.
Which PDF boundary box determines the physical page size (e.g., US Letter)?