PDF Page Resize, Extend, and Transform
When you adjust PDF layout programmatically, the result depends on whether you change the page itself or the content inside it. IronPDF gives you three distinct methods for this: Resize, Extend, and Transform. Choosing the right one comes down to whether you want to change page size, add margins, or move content.
Resize
Use Resize when you want to change the page dimensions, enlarging or shrinking the page.
public void Resize(double PageWidth, double PageHeight, MeasurementUnit Units)
public void Resize(double PageWidth, double PageHeight, MeasurementUnit Units)
Public Sub Resize(PageWidth As Double, PageHeight As Double, Units As MeasurementUnit)
End Sub
Resize changes the physical size of the page and scales the content to fit the new dimensions, so everything stays visible. A page originally 210mm x 297mm resized to 148mm x 210mm becomes A5, with its content fitted into the smaller page.
Extend
Use Extend when you want whitespace or margins around existing content without touching the content's layout, scale, or position.
public void Extend(double ExtendLeft, double ExtendRight, double ExtendTop, double ExtendBottom, MeasurementUnit Units)
public void Extend(double ExtendLeft, double ExtendRight, double ExtendTop, double ExtendBottom, MeasurementUnit Units)
Public Sub Extend(ExtendLeft As Double, ExtendRight As Double, ExtendTop As Double, ExtendBottom As Double, Units As MeasurementUnit)
End Sub
This method adds space to the page, increasing its overall size, but leaves existing content exactly where it was. Starting from a 210mm x 297mm A4 page, adding 10mm left and right plus 20mm top and bottom yields a 230mm x 337mm page with the original content centered in its old space. It is handy for preparing a PDF for printing or binding where extra margins are needed.
Sample Input

Sample Output

Transform
Use Transform to move or scale the actual content on the page while keeping the physical page size fixed.
public void Transform(double MoveX, double MoveY, double ScaleX, double ScaleY)
public void Transform(double MoveX, double MoveY, double ScaleX, double ScaleY)
Public Sub Transform(MoveX As Double, MoveY As Double, ScaleX As Double, ScaleY As Double)
End Sub
The page dimensions stay the same; only how the content appears changes. Passing values that move content right 10mm and down 5mm, then scale it to 80% in both directions, shifts and shrinks the content in place. Reach for this when correcting layouts, aligning content, or applying a zoom-out effect.
Sample Output

Choosing Between Them
- Resize: changes page size and scales content with it; mind potential clipping.
- Extend: grows the canvas with whitespace and leaves content untouched.
- Transform: moves or scales content while page dimensions stay fixed.
These methods also combine. A common pattern is resizing the page and then transforming the content to fit the new dimensions.

