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
$vbLabelText   $csharpLabel

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.

WarningResizing scales content to fit. Watch for clipping when you shrink a page significantly.

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
$vbLabelText   $csharpLabel

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

Original A4 PDF page before extending margins

Sample Output

PDF page after Extend adds whitespace margins around unchanged content

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
$vbLabelText   $csharpLabel

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

PDF page after Transform shifts and scales content within a fixed page size

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.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...

Read More
Ready to Get Started?
Nuget Downloads 19,680,294 | Version: 2026.7 just released
Still Scrolling Icon

Still Scrolling?

Want proof fast? PM > Install-Package IronPdf
run a sample watch your HTML become a PDF.