API Reference

Cmdlet

Set-OfficePdfPage

Namespace PSWriteOffice
Inputs
None
Outputs
System.IO.FileInfo

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

Remarks

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

Examples

Authored help example

Rotate selected PDF pages.

PS>


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

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.

Syntax

Set-OfficePdfPage [-Bottom <Nullable`1>] [-BoxName <MediaBox|CropBox|BleedBox|TrimBox|ArtBox>] [-Height <Nullable`1>] [-Landscape] [-Left <Nullable`1>] -OutputPath <String> [-PageRange <String>] [-PageSize <String>] -Path <String> [-ResizeMargin <Nullable`1>] [-ResizeMode <Fit|Fill|Stretch>] [-Right <Nullable`1>] [-Rotation <0|90|180|270>] [-Top <Nullable`1>] [-Width <Nullable`1>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

Bottom Nullable`1 optionalposition: namedpipeline: False
Bottom coordinate for the page boundary box.
BoxName String optionalposition: namedpipeline: Falsevalues: 5
Page boundary box to set. Supported values are MediaBox, CropBox, BleedBox, TrimBox, and ArtBox.
Possible values: MediaBox, CropBox, BleedBox, TrimBox, ArtBox
Height Nullable`1 optionalposition: namedpipeline: False
Custom page height in points when -PageSize Custom is used.
Landscape SwitchParameter optionalposition: namedpipeline: False
Use the landscape orientation of the selected page size.
Left Nullable`1 optionalposition: namedpipeline: False
Left coordinate for the page boundary box.
OutputPath String requiredposition: namedpipeline: False
Output PDF path.
PageRange String optionalposition: namedpipeline: False
Page ranges such as 1-3,5. Omit to affect all pages.
PageSize String optionalposition: namedpipeline: False
Resize selected pages to a known OfficeIMO page size such as A4, Letter, or Custom.
Path String requiredposition: namedpipeline: Falsealiases: FilePath
Input PDF path.
ResizeMargin Nullable`1 optionalposition: namedpipeline: False
Margin, in points, reserved around resized page content.
ResizeMode PdfPageResizeMode optionalposition: namedpipeline: Falsevalues: 3
How source page content is fitted into the resized output page.
Possible values: Fit, Fill, Stretch
Right Nullable`1 optionalposition: namedpipeline: False
Right coordinate for the page boundary box.
Rotation Int32 optionalposition: namedpipeline: Falsevalues: 4
Rotation in degrees. Supported values are 0, 90, 180, and 270.
Possible values: 0, 90, 180, 270
Top Nullable`1 optionalposition: namedpipeline: False
Top coordinate for the page boundary box.
Width Nullable`1 optionalposition: namedpipeline: False
Custom page width in points when -PageSize Custom is used.

Outputs

System.IO.FileInfo