# Set-OfficePdfPageSetup

Sets PDF page size, orientation, and margins. Review available syntax, parameters, pipeline guidance, and reference details in PSWriteOffice API Reference.

Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice/0.2.0)

Stars **727**

Forks **84**

Open issues **7**

Total downloads **5,275,783**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-24

Cmdlet 

Aliases: PdfPageSetup

**Module**

`PSWriteOffice`

**Aliases**

`PdfPageSetup`

**Inputs**

`OfficeIMO.Pdf.PdfDocument`

**Outputs**

`OfficeIMO.Pdf.PdfDocument`

**Source**

[SetOfficePdfPageSetupCommand.cs:21](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Pdf/SetOfficePdfPageSetupCommand.cs#L21) 

Sets PDF page size, orientation, and margins.

## Syntax

```
Set-OfficePdfPageSetup
[-Bottom <Double>]
[-Height <Double>]
[-Landscape]
[-Left <Double>]
[-Margin <Double>]
[-PageSize <String>]
[-PassThru]
[-Right <Double>]
[-Top <Double>]
[-Width <Double>]
[<CommonParameters>]
```

[#](#method-set-officepdfpagesetup-double-double-switchparameter-double-double-string-switchparameter-double-double-double)

Parameter set: `Context`

```
Set-OfficePdfPageSetup
[-Bottom <Double>]
-Document <PdfDocument>
[-Height <Double>]
[-Landscape]
[-Left <Double>]
[-Margin <Double>]
[-PageSize <String>]
[-PassThru]
[-Right <Double>]
[-Top <Double>]
[-Width <Double>]
[<CommonParameters>]
```

[#](#method-set-officepdfpagesetup-double-pdfdocument-double-switchparameter-double-double-string-switchparameter-double-double-double)

Parameter set: `Document`

## Examples

### Set page size and margins for a generated report.

```powershell
New-OfficePdf -Path .\Examples\Documents\PdfPageSetup.pdf {
    Set-OfficePdfPageSetup -PageSize A4 -Margin 42
    Add-OfficePdfHeading -Text 'A4 report'
    Add-OfficePdfParagraph -Text 'The report uses custom margins.'
}
```

Applies page setup before adding generated PDF content.

## Parameters

**-Bottom Double optional**

Bottom margin in PDF points.

**-Height Double optional**

Custom page height in PDF points when -PageSize Custom is used.

**-Landscape SwitchParameter optional**

Use landscape orientation.

**-Left Double optional**

Left margin in PDF points.

**-Margin Double optional**

Uniform margin in PDF points.

**-PageSize String optional**

Page size name: A4, A5, Letter, Legal, or Custom.

**-PassThru SwitchParameter optional**

Emit the updated document.

**-Right Double optional**

Right margin in PDF points.

**-Top Double optional**

Top margin in PDF points.

**-Width Double optional**

Custom page width in PDF points when -PageSize Custom is used.

**-Document PdfDocument requiredpipeline: True (ByValue)sets: Document**

Compatibility parameter. Page composition is supported only inside New-OfficePdf.

## Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see [about_CommonParameters](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:C269A38348166EE477F25242FE54759D5C52097EDFA04803341475389C2ADAFC -->
