Cmdlet
Remove-OfficePdfPage
Removes selected pages from a live PDF or writes edited file copies.
Syntax
Remove-OfficePdfPage
[-Document <PdfDocument>]
-Page <OfficePageSelector>
[-PassThru]
[<CommonParameters>]#Parameter set:
DocumentRemove-OfficePdfPage
[-IgnorePermissionRestrictions]
[-LoadOptions <PdfLoadOptions>]
-OutputPath <String>
-Page <OfficePageSelector>
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[<CommonParameters>]#Parameter set:
PathRemove-OfficePdfPage
[-IgnorePermissionRestrictions]
[-LoadOptions <PdfLoadOptions>]
-OutputDirectory <String>
-Page <OfficePageSelector>
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[<CommonParameters>]#Parameter set:
PathDirectoryRemove-OfficePdfPage
[-IgnorePermissionRestrictions]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
-OutputPath <String>
-Page <OfficePageSelector>
[-PassThru]
[-Password <SecureString>]
[<CommonParameters>]#Parameter set:
LiteralPathRemove-OfficePdfPage
[-IgnorePermissionRestrictions]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
-OutputDirectory <String>
-Page <OfficePageSelector>
[-PassThru]
[-Password <SecureString>]
[<CommonParameters>]#Parameter set:
LiteralPathDirectoryDescription
Inside Open-OfficePdf, omission of Document updates the current document. Outside a block, PassThru returns the native edit for assignment or further piping. File outputs are published atomically.
Examples
Remove draft pages from an output copy.
Remove-OfficePdfPage -Path ./Report.pdf -Page '4-5' -OutputPath ./Report-Clean.pdf -PassThruRemove the last page in an editing block.
Open-OfficePdf ./Report.pdf { Remove-OfficePdfPage -Page last }Parameters
- -Document PdfDocument
- Explicit native input; omission uses the enclosing New-/Open- content block.
- -Page OfficePageSelector
- Native selector, one-based page or range expression, including last, odd and even.
- -PassThru SwitchParameter
- Emit the updated native document or each saved FileInfo.
- -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.