# PdfPageRange

Represents an inclusive one-based PDF page range.

Struct 

`OfficeIMO.Pdf`

**Namespace**

`OfficeIMO.Pdf`

**Assembly**

`OfficeIMO.Pdf`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[PdfPageRange.cs:15](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageRange.cs#L15)

**Base**

`ValueType`

**Implements**

`IEquatable<PdfPageRange>`

**Modifiers**

sealed

Represents an inclusive one-based PDF page range.

## Inheritance

- ValueType
- PdfPageRange

## Usage

Explore 25 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 6

- Property [PdfBookmarkPageRange.PageRange](/api/pdf/officeimo-pdf-pdfbookmarkpagerange/#property-pagerange)
- Property [PdfLogicalTableTextExportOptions.PageRanges](/api/pdf/officeimo-pdf-pdflogicaltabletextexportoptions/#property-pageranges)
- Method [PdfPageRange.From](/api/pdf/officeimo-pdf-pdfpagerange/#method-from-int32-int32)
- Method [PdfPageRange.Parse](/api/pdf/officeimo-pdf-pdfpagerange/#method-parse-string)
- Method [PdfPageRange.ParseMany](/api/pdf/officeimo-pdf-pdfpagerange/#method-parsemany-string)
- Property [PdfPageSelection.Ranges](/api/pdf/officeimo-pdf-pdfpageselection/#property-ranges)

### Accepted by parameters 19

- Method [PdfDocumentPages.Delete](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-delete-officeimo-pdf-pdfpagerange) parameter `pageRange`
- Method [PdfDocumentPages.Duplicate](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-duplicate-officeimo-pdf-pdfpagerange) parameter `pageRange`
- Method [PdfDocumentPages.Extract](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-extract-officeimo-pdf-pdfpagerange-threading-cancellationtoken) parameter `pageRange`
- Method [PdfDocumentPages.Move](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-move-int32-officeimo-pdf-pdfpagerange) parameter `pageRange`
- Method [PdfDocumentPages.Rotate](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-rotate-int32-officeimo-pdf-pdfpagerange) parameter `pageRange`
- Method [PdfDocumentPages.Split](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-split-collections-generic-ienumerable-officeimo-pdf-pdfpagerange-threading-cancellationtoken) parameter `pageRanges`
- Method [PdfImageStampOptions.UsePageRange](/api/pdf/officeimo-pdf-pdfimagestampoptions/#method-usepagerange-officeimo-pdf-pdfpagerange) parameter `pageRange`
- Method [PdfImageStampOptions.UsePageRanges](/api/pdf/officeimo-pdf-pdfimagestampoptions/#method-usepageranges-officeimo-pdf-pdfpagerange) parameter `pageRanges`
- Method [PdfPageRange.Equals](/api/pdf/officeimo-pdf-pdfpagerange/#method-equals-officeimo-pdf-pdfpagerange) parameter `other`
- Method [PdfPageRange.op_Equality](/api/pdf/officeimo-pdf-pdfpagerange/#method-op-equality-officeimo-pdf-pdfpagerange-officeimo-pdf-pdfpagerange) parameter `left`
- Method [PdfPageRange.op_Equality](/api/pdf/officeimo-pdf-pdfpagerange/#method-op-equality-officeimo-pdf-pdfpagerange-officeimo-pdf-pdfpagerange) parameter `right`
- Method [PdfPageRange.op_Inequality](/api/pdf/officeimo-pdf-pdfpagerange/#method-op-inequality-officeimo-pdf-pdfpagerange-officeimo-pdf-pdfpagerange) parameter `left`
- Method [PdfPageRange.op_Inequality](/api/pdf/officeimo-pdf-pdfpagerange/#method-op-inequality-officeimo-pdf-pdfpagerange-officeimo-pdf-pdfpagerange) parameter `right`
- Method [PdfPageRange.TryParse](/api/pdf/officeimo-pdf-pdfpagerange/#method-tryparse-string-officeimo-pdf-pdfpagerange) parameter `range`
- Method [PdfPageRange.TryParseMany](/api/pdf/officeimo-pdf-pdfpagerange/#method-tryparsemany-string-officeimo-pdf-pdfpagerange) parameter `ranges`
- Method [PdfPageSelection.From](/api/pdf/officeimo-pdf-pdfpageselection/#method-from-officeimo-pdf-pdfpagerange) parameter `pageRange`
- Method [PdfPageSelection.FromRanges](/api/pdf/officeimo-pdf-pdfpageselection/#method-fromranges-officeimo-pdf-pdfpagerange) parameter `pageRanges`
- Method [PdfTextStampOptions.UsePageRange](/api/pdf/officeimo-pdf-pdftextstampoptions/#method-usepagerange-officeimo-pdf-pdfpagerange) parameter `pageRange`
- Method [PdfTextStampOptions.UsePageRanges](/api/pdf/officeimo-pdf-pdftextstampoptions/#method-usepageranges-officeimo-pdf-pdfpagerange) parameter `pageRanges`

Filter members 

Show inherited

## Constructors

`public PdfPageRange(int firstPage, int lastPage)` [#](#constructor-ctor-int32-int32)

[PdfPageRange.cs:15](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageRange.cs#L15)

Creates an inclusive one-based PDF page range.

Parameters

**firstPage int required**

**lastPage int required**

## Methods

Equals 2 overloads

`public bool Equals(PdfPageRange other)` [#](#method-equals-officeimo-pdf-pdfpagerange)

[PdfPageRange.cs:189](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageRange.cs#L189)

Indicates whether the current object is equal to another object of the same type.

Parameters

**other OfficeIMO.Pdf.PdfPageRange required**

An object to compare with this object.

Returns

`bool` true if the current object is equal to the other parameter; otherwise, false.

`public override bool Equals(object? obj)` [#](#method-equals-object)

[PdfPageRange.cs:194](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageRange.cs#L194)

Indicates whether this instance and a specified object are equal.

Parameters

**obj object? required**

The object to compare with the current instance.

Returns

`bool` true if obj and this instance are the same type and represent the same value; otherwise, false.

`public static PdfPageRange From(int firstPage, int lastPage)` [#](#method-from-int32-int32)

[PdfPageRange.cs:46](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageRange.cs#L46)

Creates an inclusive one-based PDF page range.

Parameters

**firstPage int required**

**lastPage int required**

Returns

`PdfPageRange`

`public override int GetHashCode()` [#](#method-gethashcode)

[PdfPageRange.cs:200](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageRange.cs#L200)

Returns the hash code for this instance.

Returns

`int` A 32-bit signed integer that is the hash code for this instance.

`public static bool op_Equality(PdfPageRange left, PdfPageRange right)` [#](#method-op-equality-officeimo-pdf-pdfpagerange-officeimo-pdf-pdfpagerange)

[PdfPageRange.cs:177](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageRange.cs#L177)

Compares two page ranges for equality.

Parameters

**left OfficeIMO.Pdf.PdfPageRange required**

**right OfficeIMO.Pdf.PdfPageRange required**

Returns

`bool`

`public static bool op_Inequality(PdfPageRange left, PdfPageRange right)` [#](#method-op-inequality-officeimo-pdf-pdfpagerange-officeimo-pdf-pdfpagerange)

[PdfPageRange.cs:184](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageRange.cs#L184)

Compares two page ranges for inequality.

Parameters

**left OfficeIMO.Pdf.PdfPageRange required**

**right OfficeIMO.Pdf.PdfPageRange required**

Returns

`bool`

`public static PdfPageRange Parse(string pageRange)` [#](#method-parse-string)

[PdfPageRange.cs:53](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageRange.cs#L53)

Parses one inclusive one-based page range from text such as 3, 1-3, or 1..3.

Parameters

**pageRange string required**

Returns

`PdfPageRange`

`public static PdfPageRange[] ParseMany(string pageRanges)` [#](#method-parsemany-string)

[PdfPageRange.cs:93](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageRange.cs#L93)

Parses comma- or semicolon-separated inclusive one-based page ranges, preserving caller order.

Parameters

**pageRanges string required**

Returns

`PdfPageRange[]`

`public override string ToString()` [#](#method-tostring)

[PdfPageRange.cs:206](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageRange.cs#L206)

Returns the fully qualified type name of this instance.

Returns

`string` The fully qualified type name.

`public static bool TryParse(string? pageRange, out PdfPageRange range)` [#](#method-tryparse-string-officeimo-pdf-pdfpagerange)

[PdfPageRange.cs:67](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageRange.cs#L67)

Attempts to parse one inclusive one-based page range from text such as 3, 1-3, or 1..3.

Parameters

**pageRange string? required**

**range OfficeIMO.Pdf.PdfPageRange required**

Returns

`bool`

`public static bool TryParseMany(string? pageRanges, out PdfPageRange[] ranges)` [#](#method-tryparsemany-string-officeimo-pdf-pdfpagerange)

[PdfPageRange.cs:118](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageRange.cs#L118)

Attempts to parse comma- or semicolon-separated inclusive one-based page ranges, preserving caller order.

Parameters

**pageRanges string? required**

**ranges OfficeIMO.Pdf.PdfPageRange[] required**

Returns

`bool`

## Inherited Methods

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

## Properties

`public int FirstPage { get; }` [#](#property-firstpage)

[PdfPageRange.cs:30](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageRange.cs#L30)

First page in the inclusive one-based range.

`public int LastPage { get; }` [#](#property-lastpage)

[PdfPageRange.cs:35](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageRange.cs#L35)

Last page in the inclusive one-based range.

`public int PageCount { get; }` [#](#property-pagecount)

[PdfPageRange.cs:40](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageRange.cs#L40)

Number of pages in the range.

<!-- PowerForge markdown artifact sha256:8B051B20908CB6DEFAAB6D87B5ED5F174B7F779119FAD7FA11033F289443F662 -->
