# PdfPageSelection

Represents caller-ordered one-based PDF page selections.

Class 

`OfficeIMO.Pdf`

**Namespace**

`OfficeIMO.Pdf`

**Assembly**

`OfficeIMO.Pdf`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[PdfPageSelection.cs:39](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageSelection.cs#L39)

**Implements**

`IEquatable<PdfPageSelection>`

**Modifiers**

sealed

Represents caller-ordered one-based PDF page selections.

## Inheritance

- object
- PdfPageSelection

## Usage

Explore 45 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 8

- Method [OfficePageSelectorPdfExtensions.ResolveSelection](/api/pdf/officeimo-pdf-officepageselectorpdfextensions/#method-resolveselection-officeimo-officepageselector-int32)
- Property [PdfLoadOptions.PageSelection](/api/pdf/officeimo-pdf-pdfloadoptions/#property-pageselection)
- Property [PdfPageAttributeEdit.Selection](/api/pdf/officeimo-pdf-pdfpageattributeedit/#property-selection)
- Method [PdfPageSelection.From](/api/pdf/officeimo-pdf-pdfpageselection/#method-from-int32)
- Method [PdfPageSelection.FromRanges](/api/pdf/officeimo-pdf-pdfpageselection/#method-fromranges-officeimo-pdf-pdfpagerange)
- Method [PdfPageSelection.Parse](/api/pdf/officeimo-pdf-pdfpageselection/#method-parse-string)
- Property [PdfProductionPreflightOptions.PageSelection](/api/pdf/officeimo-pdf-pdfproductionpreflightoptions/#property-pageselection)
- Property [PdfStaticFormRecognitionOptions.PageSelection](/api/pdf/officeimo-pdf-pdfstaticformrecognitionoptions/#property-pageselection)

### Accepted by parameters 37

- Method [PdfDocumentImageEditor.Extract](/api/pdf/officeimo-pdf-pdfdocumentimageeditor/#method-extract-officeimo-pdf-pdfpageselection-officeimo-pdf-pdfloadoptions) parameter `selection`
- Method [PdfDocumentImageEditor.Placements](/api/pdf/officeimo-pdf-pdfdocumentimageeditor/#method-placements-officeimo-pdf-pdfpageselection-officeimo-pdf-pdfloadoptions) parameter `selection`
- Method [PdfDocumentPages.Append](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-append-string-officeimo-pdf-pdfpageselection-officeimo-pdf-pdfpageimportoptions-threading-cancellationtoken) parameter `sourceSelection`
- Method [PdfDocumentPages.CropAndTranslate](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-cropandtranslate-double-double-double-double-officeimo-pdf-pdfpageselection-threading-cancellationtoken) parameter `selection`
- Method [PdfDocumentPages.Delete](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-delete-officeimo-pdf-pdfpageselection) parameter `selection`
- Method [PdfDocumentPages.DestructiveCrop](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-destructivecrop-double-double-double-double-officeimo-pdf-pdfdestructivecropoptions-officeimo-pdf-pdfpageselection-threading-cancellationtoken) parameter `selection`
- Method [PdfDocumentPages.Duplicate](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-duplicate-officeimo-pdf-pdfpageselection-threading-cancellationtoken) parameter `selection`
- Method [PdfDocumentPages.Extract](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-extract-officeimo-pdf-pdfpageselection-threading-cancellationtoken) parameter `selection`
- Method [PdfDocumentPages.ImposeBooklet](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-imposebooklet-officeimo-pdf-pdfbookletoptions-officeimo-pdf-pdfpageselection) parameter `selection`
- Method [PdfDocumentPages.ImposeNUp](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-imposenup-officeimo-pdf-pdfnupoptions-officeimo-pdf-pdfpageselection) parameter `selection`
- Method [PdfDocumentPages.Insert](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-insert-int32-officeimo-pdf-pdfdocument-officeimo-pdf-pdfpageselection-officeimo-pdf-pdfpageimportoptions-threading-cancellationtoken) parameter `sourceSelection`
- Method [PdfDocumentPages.Move](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-move-int32-officeimo-pdf-pdfpageselection-threading-cancellationtoken) parameter `selection`
- Method [PdfDocumentPages.NormalizeRotation](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-normalizerotation-officeimo-pdf-pdfpageselection-threading-cancellationtoken) parameter `selection`
- Method [PdfDocumentPages.Prepend](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-prepend-string-officeimo-pdf-pdfpageselection-officeimo-pdf-pdfpageimportoptions-threading-cancellationtoken) parameter `sourceSelection`
- Method [PdfDocumentPages.Reorder](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-reorder-officeimo-pdf-pdfpageselection-threading-cancellationtoken) parameter `selection`
- Method [PdfDocumentPages.ReorderWithMapping](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-reorderwithmapping-officeimo-pdf-pdfpageselection-threading-cancellationtoken) parameter `order`
- Method [PdfDocumentPages.Resize](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-resize-officeimo-pdf-pdfpageresizeoptions-officeimo-pdf-pdfpageselection-threading-cancellationtoken) parameter `selection`
- Method [PdfDocumentPages.Rotate](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-rotate-int32-officeimo-pdf-pdfpageselection) parameter `selection`
- Method [PdfDocumentPages.RotateBy](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-rotateby-int32-officeimo-pdf-pdfpageselection-threading-cancellationtoken) parameter `selection`
- Method [PdfDocumentPages.SetArtBox](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-setartbox-double-double-double-double-officeimo-pdf-pdfpageselection-threading-cancellationtoken) parameter `selection`
- Method [PdfDocumentPages.SetBleedBox](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-setbleedbox-double-double-double-double-officeimo-pdf-pdfpageselection-threading-cancellationtoken) parameter `selection`
- Method [PdfDocumentPages.SetCropBox](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-setcropbox-double-double-double-double-officeimo-pdf-pdfpageselection-threading-cancellationtoken) parameter `selection`
- Method [PdfDocumentPages.SetMediaBox](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-setmediabox-double-double-double-double-officeimo-pdf-pdfpageselection-threading-cancellationtoken) parameter `selection`
- Method [PdfDocumentPages.SetPageBox](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-setpagebox-officeimo-pdf-pdfpageboundarybox-double-double-double-double-officeimo-pdf-pdfpageselection-threading-cancellationtoken) parameter `selection`
- Method [PdfDocumentPages.SetTrimBox](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-settrimbox-double-double-double-double-officeimo-pdf-pdfpageselection-threading-cancellationtoken) parameter `selection`
- Method [PdfDocumentPages.Split](/api/pdf/officeimo-pdf-pdfdocumentpages/#method-split-collections-generic-ireadonlylist-officeimo-pdf-pdfpageselection-threading-cancellationtoken) parameter `selections`
- Method [PdfDocumentProof.CompareVisual](/api/pdf/officeimo-pdf-pdfdocumentproof/#method-comparevisual-byte-officeimo-pdf-pdfpageselection-officeimo-pdf-pdfvisualcomparisonoptions-officeimo-pdf-pdfloadoptions) parameter `selection`
- Method [PdfDocumentRenderer.Pages](/api/pdf/officeimo-pdf-pdfdocumentrenderer/#method-pages-officeimo-pdf-pdfpageselection-officeimo-pdf-pdfpagerenderoptions-threading-cancellationtoken) parameter `selection`
- Method [PdfDocumentResources.Fonts](/api/pdf/officeimo-pdf-pdfdocumentresources/#method-fonts-officeimo-pdf-pdfpageselection-officeimo-pdf-pdffontinspectionoptions-officeimo-pdf-pdfloadoptions) parameter `selection`
- Method [PdfPageAttributeEdit.CropMargins](/api/pdf/officeimo-pdf-pdfpageattributeedit/#method-cropmargins-double-double-double-double-officeimo-pdf-pdfpageselection) parameter `selection`
- Method [PdfPageAttributeEdit.ResetCrop](/api/pdf/officeimo-pdf-pdfpageattributeedit/#method-resetcrop-officeimo-pdf-pdfpageselection) parameter `selection`
- Method [PdfPageAttributeEdit.RotateBy](/api/pdf/officeimo-pdf-pdfpageattributeedit/#method-rotateby-int32-officeimo-pdf-pdfpageselection) parameter `selection`
- Method [PdfPageAttributeEdit.SetBox](/api/pdf/officeimo-pdf-pdfpageattributeedit/#method-setbox-officeimo-pdf-pdfpageboundarybox-double-double-double-double-officeimo-pdf-pdfpageselection) parameter `selection`
- Method [PdfPageAttributeEdit.SetRotation](/api/pdf/officeimo-pdf-pdfpageattributeedit/#method-setrotation-int32-officeimo-pdf-pdfpageselection) parameter `selection`
- Method [PdfPageSelection.Equals](/api/pdf/officeimo-pdf-pdfpageselection/#method-equals-officeimo-pdf-pdfpageselection) parameter `other`
- Method [PdfPageSelection.TryParse](/api/pdf/officeimo-pdf-pdfpageselection/#method-tryparse-string-officeimo-pdf-pdfpageselection) parameter `selection`
- Method [PdfVisualComparer.Compare](/api/pdf/officeimo-pdf-pdfvisualcomparer/#method-compare-byte-byte-officeimo-pdf-pdfpageselection-officeimo-pdf-pdfvisualcomparisonoptions-officeimo-pdf-pdfloadoptions-officeimo-pdf-pdfloadoptions) parameter `selection`

Filter members 

Show inherited

## Methods

Equals 2 overloads

`public bool Equals(PdfPageSelection? other)` [#](#method-equals-officeimo-pdf-pdfpageselection)

[PdfPageSelection.cs:111](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageSelection.cs#L111)

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

Parameters

**other OfficeIMO.Pdf.PdfPageSelection? 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)

[PdfPageSelection.cs:130](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageSelection.cs#L130)

Determines whether the specified object is equal to the current object.

Parameters

**obj object? required**

The object to compare with the current object.

Returns

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

From 2 overloads

`public static PdfPageSelection From(params int[] pageNumbers)` [#](#method-from-int32)

[PdfPageSelection.cs:39](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageSelection.cs#L39)

Creates a selection from one or more one-based page numbers.

Parameters

**pageNumbers int[] required**

Returns

`PdfPageSelection`

`public static PdfPageSelection From(PdfPageRange pageRange)` [#](#method-from-officeimo-pdf-pdfpagerange)

[PdfPageSelection.cs:56](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageSelection.cs#L56)

Creates a selection from one inclusive one-based page range.

Parameters

**pageRange OfficeIMO.Pdf.PdfPageRange required**

Returns

`PdfPageSelection`

`public static PdfPageSelection FromRanges(params PdfPageRange[] pageRanges)` [#](#method-fromranges-officeimo-pdf-pdfpagerange)

[PdfPageSelection.cs:63](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageSelection.cs#L63)

Creates a selection from one or more inclusive one-based page ranges.

Parameters

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

Returns

`PdfPageSelection`

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

[PdfPageSelection.cs:136](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageSelection.cs#L136)

Serves as the default hash function.

Returns

`int` A hash code for the current object.

`public static PdfPageSelection Parse(string pageRanges)` [#](#method-parse-string)

[PdfPageSelection.cs:75](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageSelection.cs#L75)

Parses comma- or semicolon-separated one-based page ranges such as 1, 1-3, or 3,1-2.

Parameters

**pageRanges string required**

Returns

`PdfPageSelection`

`public IReadOnlyList<int> Resolve(int pageCount)` [#](#method-resolve-int32)

[PdfPageSelection.cs:101](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageSelection.cs#L101)

Resolves this selection against a document page count, preserving caller order and repeated pages.

Parameters

**pageCount int required**

Returns

`IReadOnlyList<int>`

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

[PdfPageSelection.cs:147](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageSelection.cs#L147)

Returns a string that represents the current object.

Returns

`string` A string that represents the current object.

`public static bool TryParse(string? pageRanges, out PdfPageSelection? selection)` [#](#method-tryparse-string-officeimo-pdf-pdfpageselection)

[PdfPageSelection.cs:82](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageSelection.cs#L82)

Attempts to parse comma- or semicolon-separated one-based page ranges.

Parameters

**pageRanges string? required**

**selection OfficeIMO.Pdf.PdfPageSelection? required**

Returns

`bool`

## Inherited Methods

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

Inherited from object

Returns

`Type`

## Properties

`public IReadOnlyList<PdfPageRange> Ranges { get; }` [#](#property-ranges)

[PdfPageSelection.cs:19](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageSelection.cs#L19)

Inclusive one-based ranges in caller order.

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

[PdfPageSelection.cs:26](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfPageSelection.cs#L26)

Total selected page count before operation-specific de-duplication.

<!-- PowerForge markdown artifact sha256:281780EDE4BC3D81BF4466E75A37FE19AB9CF597432F365FB19C11472B45E138 -->
