# Set-OfficePdfPage

Sets page-level PDF properties and writes a new PDF.

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 

**Module**

`PSWriteOffice`

**Inputs**

`None`

**Outputs**

`System.IO.FileInfo`

**Source**

[SetOfficePdfPageCommand.cs:23](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Pdf/SetOfficePdfPageCommand.cs#L23) 

Sets page-level PDF properties and writes a new PDF.

## Syntax

```
Set-OfficePdfPage
[-Bottom <Double>]
[-BoxName <MediaBox|CropBox|BleedBox|TrimBox|ArtBox>]
[-Height <Double>]
[-IgnorePermissionRestrictions]
[-Landscape]
[-Left <Double>]
-OutputPath <String>
[-PageRange <String>]
[-PageSize <String>]
[-PassThru]
[-Password <String>]
-Path <String>
[-ResizeMargin <Double>]
[-ResizeMode <Fit|Fill|Stretch>]
[-Right <Double>]
[-Rotation <0|90|180|270>]
[-Top <Double>]
[-Width <Double>]
[<CommonParameters>]
```

[#](#method-set-officepdfpage-double-pdfpageboundarybox-double-switchparameter-switchparameter-double-string-string-string-switchparameter-string-string-double-pdfpageresizemode-double-int32-double-double)

Parameter set: `All Parameter Sets`

## Examples

### Rotate selected PDF pages.

```powershell
$proof = @(
    Set-OfficePdfPage -Path .\Examples\Documents\Scanned.pdf -PageRange '2,4' -Rotation 90 -OutputPath .\Examples\Documents\Scanned-Rotated.pdf
    Get-OfficePdfInfo -Path .\Examples\Documents\Scanned-Rotated.pdf | Select-Object PageCount
)
$proof
```

Rotates selected pages and writes a new PDF.

## Parameters

**-Bottom Double optional**

Bottom coordinate for the page boundary box.

**-BoxName PdfPageBoundaryBox optional**

Page boundary box to set. Supported values are MediaBox, CropBox, BleedBox, TrimBox, and ArtBox.

Possible values: `MediaBox`, `CropBox`, `BleedBox`, `TrimBox`, `ArtBox`

**-Height Double optional**

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

**-IgnorePermissionRestrictions SwitchParameter optional**

After successful password authentication, explicitly ignore owner-imposed page-modification restrictions.

**-Landscape SwitchParameter optional**

Use the landscape orientation of the selected page size.

**-Left Double optional**

Left coordinate for the page boundary box.

**-OutputPath String required**

Output PDF path.

**-PageRange String optional**

Page ranges such as 1-3,5. Omit to affect all pages.

**-PageSize String optional**

Resize selected pages to a known OfficeIMO page size such as A4, Letter, or Custom.

**-PassThru SwitchParameter optional**

Emit the object created or changed by the command.

**-Password String optional**

Password used to authenticate an encrypted PDF.

**-Path String requiredaliases: FilePath**

Input PDF path.

**-ResizeMargin Double optional**

Margin, in points, reserved around resized page content.

**-ResizeMode PdfPageResizeMode optional**

How source page content is fitted into the resized output page.

Possible values: `Fit`, `Fill`, `Stretch`

**-Right Double optional**

Right coordinate for the page boundary box.

**-Rotation Int32 optional**

Rotation in degrees. Supported values are 0, 90, 180, and 270.

Possible values: `0`, `90`, `180`, `270`

**-Top Double optional**

Top coordinate for the page boundary box.

**-Width Double optional**

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

## 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:D27BCD0AE076072BB37B5E692ADCDC3A3DB8C7A613E6CECDAEA296EE48D56FC0 -->
