SplitDocumentByOutline
Page manipulation
Description
Splits the document at its outline entries
Syntax
Delphi
Function SplitDocumentByOutline(MaxLevel: Integer; Const NameTemplate: WideString): Integer;Parameters
| MaxLevel | Outline depth that defines split points; 1 cuts at top-level bookmarks |
|---|---|
| NameTemplate | Output path template; %p receives the section sequence number |
Return values
The number of files written. If writing a section fails, the operation stops and returns the number already written. Check LastErrorCode for the failure reason
Remarks
The library uses the current document in memory, including its unsaved edits. It collects local destinations through the requested outline depth, sorts them by page number, and combines duplicate destinations. Each section starts at its split point and ends before the next one. The last section runs to the final page. Pages before the first split point are omitted