API Reference

Cmdlet

Copy-OfficePdfPage

Namespace PSWriteOffice
Inputs
None
Outputs
System.IO.FileInfo

Copies selected PDF pages into a new PDF.

Remarks

Copies selected PDF pages into a new PDF.

Examples

Authored help example

Extract a page range into a new PDF.

PS>


$proof = @(
                Copy-OfficePdfPage -Path .\Examples\Documents\Report.pdf -PageRange '1-2,5' -OutputPath .\Examples\Documents\ExecutivePages.pdf
                Get-OfficePdfInfo -Path .\Examples\Documents\ExecutivePages.pdf | Select-Object PageCount
            )
            $proof
        

Copies selected pages and inspects the resulting 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

Copy-OfficePdfPage -OutputPath <String> -PageRange <String> -Path <String> [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

OutputPath String requiredposition: namedpipeline: False
Output PDF path.
PageRange String requiredposition: namedpipeline: False
Page ranges such as 1-3,5.
Path String requiredposition: namedpipeline: Falsealiases: FilePath
Input PDF path.

Outputs

System.IO.FileInfo