# Set-OfficePdfPage

Rotates pages, sets boundary boxes or resizes pages through the native PDF engine.

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`OfficeIMO.Pdf.PdfDocument` `System.String[]`

**Outputs**

`OfficeIMO.Pdf.PdfDocument` `System.IO.FileInfo`

**Source**

[SetOfficePdfPageCommand.cs:13](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/PowerShell/PSWriteOffice/Sources/PSWriteOffice/Cmdlets/Pdf/SetOfficePdfPageCommand.cs#L13) 

Rotates pages, sets boundary boxes or resizes pages through the native PDF engine.

## Syntax

```
Set-OfficePdfPage
[-BoxBottom <OfficeLength>]
[-BoxLeft <OfficeLength>]
[-BoxName <MediaBox|CropBox|BleedBox|TrimBox|ArtBox>]
[-BoxRight <OfficeLength>]
[-BoxTop <OfficeLength>]
[-Document <PdfDocument>]
[-Height <OfficeLength>]
[-Orientation <Portrait|Landscape>]
[-Page <OfficePageRange>]
[-PageSize <OfficePageSize>]
[-PassThru]
[-ResizeMargin <OfficeLength>]
[-ResizeMode <Fit|Fill|Stretch>]
[-Rotation <0|90|180|270>]
[-Width <OfficeLength>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#member-e26c774255788757ddcdcb25)

Parameter set: `Document`

```
Set-OfficePdfPage
[-BoxBottom <OfficeLength>]
[-BoxLeft <OfficeLength>]
[-BoxName <MediaBox|CropBox|BleedBox|TrimBox|ArtBox>]
[-BoxRight <OfficeLength>]
[-BoxTop <OfficeLength>]
[-Height <OfficeLength>]
[-IgnorePermissionRestrictions]
[-LoadOptions <PdfLoadOptions>]
[-Orientation <Portrait|Landscape>]
-OutputPath <String>
[-Page <OfficePageRange>]
[-PageSize <OfficePageSize>]
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[-ResizeMargin <OfficeLength>]
[-ResizeMode <Fit|Fill|Stretch>]
[-Rotation <0|90|180|270>]
[-Width <OfficeLength>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#member-a889660482b264c624bba1dc)

Parameter set: `Path`

```
Set-OfficePdfPage
[-BoxBottom <OfficeLength>]
[-BoxLeft <OfficeLength>]
[-BoxName <MediaBox|CropBox|BleedBox|TrimBox|ArtBox>]
[-BoxRight <OfficeLength>]
[-BoxTop <OfficeLength>]
[-Height <OfficeLength>]
[-IgnorePermissionRestrictions]
[-LoadOptions <PdfLoadOptions>]
[-Orientation <Portrait|Landscape>]
-OutputDirectory <String>
[-Page <OfficePageRange>]
[-PageSize <OfficePageSize>]
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[-ResizeMargin <OfficeLength>]
[-ResizeMode <Fit|Fill|Stretch>]
[-Rotation <0|90|180|270>]
[-Width <OfficeLength>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#member-2e287ef0095f183e79a62335)

Parameter set: `PathDirectory`

```
Set-OfficePdfPage
[-BoxBottom <OfficeLength>]
[-BoxLeft <OfficeLength>]
[-BoxName <MediaBox|CropBox|BleedBox|TrimBox|ArtBox>]
[-BoxRight <OfficeLength>]
[-BoxTop <OfficeLength>]
[-Height <OfficeLength>]
[-IgnorePermissionRestrictions]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
[-Orientation <Portrait|Landscape>]
-OutputPath <String>
[-Page <OfficePageRange>]
[-PageSize <OfficePageSize>]
[-PassThru]
[-Password <SecureString>]
[-ResizeMargin <OfficeLength>]
[-ResizeMode <Fit|Fill|Stretch>]
[-Rotation <0|90|180|270>]
[-Width <OfficeLength>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#member-f2072fb8fe337c39f5a2d374)

Parameter set: `LiteralPath`

```
Set-OfficePdfPage
[-BoxBottom <OfficeLength>]
[-BoxLeft <OfficeLength>]
[-BoxName <MediaBox|CropBox|BleedBox|TrimBox|ArtBox>]
[-BoxRight <OfficeLength>]
[-BoxTop <OfficeLength>]
[-Height <OfficeLength>]
[-IgnorePermissionRestrictions]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
[-Orientation <Portrait|Landscape>]
-OutputDirectory <String>
[-Page <OfficePageRange>]
[-PageSize <OfficePageSize>]
[-PassThru]
[-Password <SecureString>]
[-ResizeMargin <OfficeLength>]
[-ResizeMode <Fit|Fill|Stretch>]
[-Rotation <0|90|180|270>]
[-Width <OfficeLength>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#member-06472e077b7ee42fe860b245)

Parameter set: `LiteralPathDirectory`

## Examples

### Example 1

```powershell
Set-OfficePdfPage -BoxBottom 'Value'
```

### Example 2

```powershell
Set-OfficePdfPage -LiteralPath @('C:\Path') -OutputPath 'C:\Path'
```

### Example 3

```powershell
Set-OfficePdfPage -LiteralPath @('C:\Path') -OutputDirectory 'Value'
```

## Parameters

**-BoxBottom OfficeLength optional**

Bottom boundary coordinate.

**-BoxLeft OfficeLength optional**

Left boundary coordinate.

**-BoxName PdfPageBoundaryBox optional**

Page boundary box to set.

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

**-BoxRight OfficeLength optional**

Right boundary coordinate.

**-BoxTop OfficeLength optional**

Top boundary coordinate.

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

Explicit native input; omission uses the enclosing New-/Open- content block.

**-Height OfficeLength optional**

Custom page height.

**-Orientation OfficePageOrientation optional**

Orientation of the target page.

Possible values: `Portrait`, `Landscape`

**-Page OfficePageRange optional**

One-based pages; omission selects every page.

**-PageSize OfficePageSize optional**

Paper preset or physical dimensions for resizing.

**-PassThru SwitchParameter optional**

Emit the updated native document or each saved FileInfo.

**-ResizeMargin OfficeLength optional**

Margin reserved around fitted content.

**-ResizeMode PdfPageResizeMode optional**

How original page content fits the resized page.

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

**-Rotation Int32 optional**

Absolute rotation in degrees.

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

**-Width OfficeLength optional**

Custom page width.

**-WhatIf SwitchParameter optional**

Shows what would happen if the command runs.

**-Confirm SwitchParameter optional**

Prompts for confirmation before running the command.

**-IgnorePermissionRestrictions SwitchParameter optionalsets: Path, PathDirectory, LiteralPath, LiteralPathDirectory**

After authentication, explicitly ignore owner-imposed usage restrictions.

**-LoadOptions PdfLoadOptions optionalsets: Path, PathDirectory, LiteralPath, LiteralPathDirectory**

Native source parsing, authentication and resource settings.

**-OutputPath String requiredsets: Path, LiteralPath**

Single-file destination.

**-Password SecureString optionalsets: Path, PathDirectory, LiteralPath, LiteralPathDirectory**

Source password.

**-Path String[] requiredposition: 0sets: Path, PathDirectory**

Input files with FileSystem wildcard expansion.

**-OutputDirectory String requiredsets: PathDirectory, LiteralPathDirectory**

Destination folder retaining input file names.

**-LiteralPath String[] requiredpipeline: True (ByPropertyName)aliases: FullName, PSPathsets: LiteralPath, LiteralPathDirectory**

Literal input files, including FileInfo.FullName.

## 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).

<!-- PowerForge markdown artifact sha256:0E8F65A3B00F9B6664A4D2E11CE3EF015555DFB8E8D950E3F7EBC1909B5673C3 -->
