moveOutline method
Future<bool>
moveOutline({
- required CPDFOutline outline,
- required CPDFOutline newParent,
- int insertIndex = -1,
Moves the specified outline to a new parent outline at the given insert position.
This method repositions an existing outline within the document's outline tree. It changes the parent of the outline and inserts it at the specified index under the new parent.
Parameters:
outline: The outline node to be moved.newParent: The target parent outline under which the node will be placed.insertIndex: The position at which to insert the outline undernewParent. Use-1to append the outline to the end.
Example:
bool result = await document.moveOutline(
outline: outlineToMove,
newParent: targetParentOutline,
insertIndex: 0,
);
Returns:
trueif the operation succeeds; otherwise,false.
Implementation
Future<bool> moveOutline({
required CPDFOutline outline,
required CPDFOutline newParent,
int insertIndex = -1,
}) async {
return await _channel.invokeMethod('move_to_outline', {
'new_parent_uuid': newParent.uuid,
'uuid': outline.uuid,
'insert_index': insertIndex,
});
}