Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Split-OfficeDocument

Module
PSWriteOffice
Inputs
System.String[]
Outputs
System.IO.FileInfo

Splits PDF files into consecutive groups, selected ranges or top-level bookmarked chapters.

Syntax

Split-OfficeDocument
[-IndexWidth <Int32>]
[-NoClobber]
[-Options <Object[]>]
[-OutputDirectory] <String>
[-PadIndex]
[-PageCount <Int32>]
[-Password <SecureString>]
[-Path] <String[]>
[-Prefix <String>]
[-ThrottleLimit <Int32>]
[<CommonParameters>]
#
Parameter set: PathByPageCount
Split-OfficeDocument
[-IndexWidth <Int32>]
[-NoClobber]
[-Options <Object[]>]
[-OutputDirectory] <String>
[-PadIndex]
-Page <String[]>
[-Password <SecureString>]
[-Path] <String[]>
[-Prefix <String>]
[-ThrottleLimit <Int32>]
[<CommonParameters>]
#
Parameter set: PathByRange
Split-OfficeDocument
[-Bookmark <String[]>]
-ByBookmark
[-IndexWidth <Int32>]
[-NoClobber]
[-Options <Object[]>]
[-OutputDirectory] <String>
[-PadIndex]
[-Password <SecureString>]
[-Path] <String[]>
[-Prefix <String>]
[-ThrottleLimit <Int32>]
[<CommonParameters>]
#
Parameter set: PathByBookmark
Split-OfficeDocument
[-IndexWidth <Int32>]
-LiteralPath <String[]>
[-NoClobber]
[-Options <Object[]>]
[-OutputDirectory] <String>
[-PadIndex]
[-PageCount <Int32>]
[-Password <SecureString>]
[-Prefix <String>]
[-ThrottleLimit <Int32>]
[<CommonParameters>]
#
Parameter set: LiteralPathByPageCount
Split-OfficeDocument
[-IndexWidth <Int32>]
-LiteralPath <String[]>
[-NoClobber]
[-Options <Object[]>]
[-OutputDirectory] <String>
[-PadIndex]
-Page <String[]>
[-Password <SecureString>]
[-Prefix <String>]
[-ThrottleLimit <Int32>]
[<CommonParameters>]
#
Parameter set: LiteralPathByRange
Split-OfficeDocument
[-Bookmark <String[]>]
-ByBookmark
[-IndexWidth <Int32>]
-LiteralPath <String[]>
[-NoClobber]
[-Options <Object[]>]
[-OutputDirectory] <String>
[-PadIndex]
[-Password <SecureString>]
[-Prefix <String>]
[-ThrottleLimit <Int32>]
[<CommonParameters>]
#
Parameter set: LiteralPathByBookmark

Description

Each completed file is returned immediately. Native page extraction retains its permission, signature and preservation policies. Only the selected files are written; other folder contents remain intact.

Examples

Split each incoming scan into two-page records.

Get-ChildItem ./Scans -Filter *.pdf | Split-OfficeDocument -OutputDirectory ./Records -PageCount 2 -NoClobber

Keep nested sections inside their chapter.

Split-OfficeDocument -LiteralPath './Manual [final].pdf' -OutputDirectory ./Chapters -ByBookmark

Parameters

-IndexWidth Int32 optional
Explicit numeric index width, up to 32 characters.
-NoClobber SwitchParameter optional
Refuse to replace an existing part, including a file created by another writer.
-Options Object[] optional
Native PDF load settings or property overrides; includes resource and permission policies.
-OutputDirectory String requiredposition: 1
Destination folder. File names begin with Prefix or the source base name.
-PadIndex SwitchParameter optional
Pad numeric part indexes to the width of the source page count.
-PageCount Int32 optionalsets: PathByPageCount, LiteralPathByPageCount
Consecutive source pages per output; defaults to one.
-Password SecureString optional
Input password; accepts a credential or warned plain text.
-Path String[] requiredposition: 0pipeline: True (ByValue)sets: PathByPageCount, PathByRange, PathByBookmark
Input files in provider and pipeline order.
-Prefix String optional
Portable output file-name prefix; defaults to the source base name.
-ThrottleLimit Int32 optional
Maximum concurrent input files.
-Page String[] requiredsets: PathByRange, LiteralPathByRange
One output per range string, for example '1-3','4,6'.
-Bookmark String[] optionalsets: PathByBookmark, LiteralPathByBookmark
Only these exact top-level bookmark titles; omission selects every chapter.
-ByBookmark SwitchParameter requiredsets: PathByBookmark, LiteralPathByBookmark
Split at top-level bookmarks; nested pages remain within their chapter.
-LiteralPath String[] requiredpipeline: True (ByPropertyName)aliases: FullName, PSPathsets: LiteralPathByPageCount, LiteralPathByRange, LiteralPathByBookmark
Literal files; also binds FileInfo.FullName and provider PSPath properties.

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.