Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Set-OfficePdfPage

Module
PSWriteOffice
Inputs
OfficeIMO.Pdf.PdfDocument System.String[]
Outputs
OfficeIMO.Pdf.PdfDocument System.IO.FileInfo

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: 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>]
#
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>]
#
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>]
#
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>]
#
Parameter set: LiteralPathDirectory

Examples

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