Cmdlet
Set-OfficePdfPage
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>]#Parameter set:
DocumentSet-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>]#Parameter set:
PathSet-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>]#Parameter set:
PathDirectorySet-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>]#Parameter set:
LiteralPathSet-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>]#Parameter set:
LiteralPathDirectoryExamples
Example 1
Set-OfficePdfPage -BoxBottom 'Value'Example 2
Set-OfficePdfPage -LiteralPath @('C:\Path') -OutputPath 'C:\Path'Example 3
Set-OfficePdfPage -LiteralPath @('C:\Path') -OutputDirectory 'Value'Parameters
- -BoxBottom OfficeLength
- Bottom boundary coordinate.
- -BoxLeft OfficeLength
- Left boundary coordinate.
- -BoxName PdfPageBoundaryBox
- Page boundary box to set.
- Possible values:
MediaBox,CropBox,BleedBox,TrimBox,ArtBox - -BoxRight OfficeLength
- Right boundary coordinate.
- -BoxTop OfficeLength
- Top boundary coordinate.
- -Document PdfDocument
- Explicit native input; omission uses the enclosing New-/Open- content block.
- -Height OfficeLength
- Custom page height.
- -Orientation OfficePageOrientation
- Orientation of the target page.
- Possible values:
Portrait,Landscape - -Page OfficePageRange
- One-based pages; omission selects every page.
- -PageSize OfficePageSize
- Paper preset or physical dimensions for resizing.
- -PassThru SwitchParameter
- Emit the updated native document or each saved FileInfo.
- -ResizeMargin OfficeLength
- Margin reserved around fitted content.
- -ResizeMode PdfPageResizeMode
- How original page content fits the resized page.
- Possible values:
Fit,Fill,Stretch - -Rotation Int32
- Absolute rotation in degrees.
- Possible values:
0,90,180,270 - -Width OfficeLength
- Custom page width.
- -WhatIf SwitchParameter
- Shows what would happen if the command runs.
- -Confirm SwitchParameter
- Prompts for confirmation before running the command.
- -IgnorePermissionRestrictions SwitchParameter
- After authentication, explicitly ignore owner-imposed usage restrictions.
- -LoadOptions PdfLoadOptions
- Native source parsing, authentication and resource settings.
- -OutputPath String
- Single-file destination.
- -Password SecureString
- Source password.
- -Path String[]
- Input files with FileSystem wildcard expansion.
- -OutputDirectory String
- Destination folder retaining input file names.
- -LiteralPath String[]
- 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.