Method RemoveRange
- Namespace
- BitMiracle.Docotic.Pdf
- Assembly
- BitMiracle.Docotic.Pdf.dll
RemoveRange(int, int)
Removes a range of pages from the document's page collection.
public void RemoveRange(int index, int count)
Parameters
indexintThe zero-based starting index of the range of pages to remove.
countintThe number of pages to remove.
Remarks
The combination of index and count must not
remove all pages from the document, because the document must contain at least one page
after the operation. A PdfException is thrown when attempting to remove
all pages.
Splitting PDF documents is one of the use cases for this method. See the Split PDF documents in C# and VB.NET article for other approaches to this use case.
Exceptions
- ArgumentOutOfRangeException
Thrown when
indexis outside the bounds of the collection, whencountis less than or equal to0, or whenindex+countexceeds the number of pages in the document.