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
fromIndexintThe zero-based index of the page to move.
toIndexintThe 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
fromIndexis outside the bounds of the collection, or whentoIndexis less than0or 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
sourceIndexesint[]The zero-based indexes of the pages to move.
toIndexintThe 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
sourceIndexesisnull.- ArgumentException
Thrown when
sourceIndexesis empty or contains duplicate values.- ArgumentOutOfRangeException
Thrown when an index in
sourceIndexesis outside the bounds of the collection, or whentoIndexis less than0or greater than Count.