SplitDocumentByOutline

Page manipulation

Description

Splits the document at its outline entries

Syntax

Delphi

Function SplitDocumentByOutline(MaxLevel: Integer; Const NameTemplate: WideString): Integer;

Parameters

MaxLevelOutline depth that defines split points; 1 cuts at top-level bookmarks
NameTemplateOutput 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

See also

ExtractFilePages, SplitDocumentToFiles