Class PageRange
Class representing a page range, for instance a page range can contain pages 5, then pages 10 through 15, then page 18, then page 21 and so on.
public class PageRange
- Inheritance
-
PageRange
- Inherited Members
Constructors
PageRange()
Constructs an empty PageRange instance.
public PageRange()
PageRange(string)
Constructs a PageRange instance from a range in a string form, for example: "1-12, 15, 45-66".
public PageRange(string pageRange)
Parameters
pageRange
stringa String of page ranges
Remarks
Constructs a PageRange instance from a range in a string form, for example: "1-12, 15, 45-66". More advanced forms are also available, for example:
- "3-" to indicate from page 3 to the last page
- "odd" for all odd pages
- "even" for all even pages
- "3- & odd" for all odd pages starting from page 3 A complete example for pages 1 to 5, page 8 then odd pages starting from page 9: "1-5, 8, odd & 9-".
Methods
AddPageRangePart(IPageRangePart)
Adds any page range part to this page range.
public virtual PageRange AddPageRangePart(PageRange.IPageRangePart part)
Parameters
part
PageRange.IPageRangeParta custom implementation of PageRange.IPageRangePart
Returns
- PageRange
this range, already modified
Remarks
Adds any page range part to this page range. Users may define and plug in custom implementations for behavior not found in the standard library.
AddPageSequence(int, int)
Adds a page sequence to the range.
public virtual PageRange AddPageSequence(int startPageNumber, int endPageNumber)
Parameters
startPageNumber
intthe starting page number of the sequence
endPageNumber
intthe finishing page number of the sequence
Returns
- PageRange
this range, already modified
AddSinglePage(int)
Adds a single page to the range.
public virtual PageRange AddSinglePage(int pageNumber)
Parameters
pageNumber
intthe page number to add
Returns
- PageRange
this range, already modified
Equals(object)
public override bool Equals(object obj)
Parameters
obj
object
Returns
GetHashCode()
public override int GetHashCode()
Returns
GetQualifyingPageNums(int)
Gets the list of pages that have been added to the range so far.
public virtual IList<int> GetQualifyingPageNums(int nbPages)
Parameters
nbPages
intnumber of pages of the document to get the pages, to list only the pages eligible for this document.
Returns
IsPageInRange(int)
Checks if a given page is present in the range built so far.
public virtual bool IsPageInRange(int pageNumber)
Parameters
pageNumber
intthe page number to check
Returns
- bool
true
if the page is present in this range,false
otherwise