Table of Contents

Method Move

Namespace
BitMiracle.Docotic.Pdf
Assembly
BitMiracle.Docotic.Pdf.dll

Move(int, int)

Changes the position of a page within the collection of document pages.

public void Move(int fromIndex, int toIndex)

Parameters

fromIndex int

The zero-based index of the page to move.

toIndex int

The zero-based index to move the page to.

Remarks

The page being moved is inserted before the page at the position specified by toIndex. After insertion, the collection is compacted by shifting pages toward the beginning of the collection.

If toIndex equals Count, the page is moved to the end of the collection.

See the Prepend PDF section for examples of reordering pages in a PDF document.

Exceptions

ArgumentOutOfRangeException

Thrown when fromIndex is outside the bounds of the collection, or when toIndex is less than 0 or greater than Count.

Move(int[], int)

Changes the position of multiple pages within the collection of document pages.

public void Move(int[] sourceIndexes, int toIndex)

Parameters

sourceIndexes int[]

The zero-based indexes of the pages to move.

toIndex int

The zero-based index to move the pages to.

Remarks

All pages specified in sourceIndexes are inserted before the page at the position specified by toIndex, in the order in which the indexes appear in sourceIndexes. After insertion, the collection is compacted by shifting pages toward the beginning of the collection.

If toIndex equals Count, the pages are moved to the end of the collection.

See the Prepend PDF section for examples of reordering pages in a PDF document.

Exceptions

ArgumentNullException

Thrown when sourceIndexes is null.

ArgumentException

Thrown when sourceIndexes is empty or contains duplicate values.

ArgumentOutOfRangeException

Thrown when an index in sourceIndexes is outside the bounds of the collection, or when toIndex is less than 0 or greater than Count.