# PageLabel Class

> Describes numbering labels for a range of pages.

- Product: Adobe PDF Library 21
- Language: Modern C++
- Version: 21.4.0
- HTML page: https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/PageLabel
- Version index: https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/llms.txt

```cpp
class PageLabel
```

**Namespace:** `datalogics_interface`

## Description

Describes numbering labels for a range of pages.

PageLabel describes how to construct a label string for a range of pages. It contains information on number style, any prefixes, and a starting position within the document.

Note that a single PageLabel describes the label string for several pages all pages up until the first page covered by the next PageLabel, or the end of the document.

Also note that if a Document has any PageLabels, there must be one that starts at page index 0. This will be automatically created if the user does not supply one.

**Referenced by:** [`Document`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/Document.md)

**Uses types:** [`NumberStyle`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/enum/NumberStyle.md)

## Constructors

### PageLabel

```cpp
datalogics_interface::PageLabel::PageLabel(const PageLabel &other)
```

*constructor*

**Parameters**

- `other` ([`const PageLabel &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/PageLabel.md))

Copy constructor.

### PageLabel

```cpp
datalogics_interface::PageLabel::PageLabel(int start_page_index, NumberStyle style)
```

*constructor*

**Parameters**

- `start_page_index` (`int`): Starting page index in the Document for this range
- `style` ([`NumberStyle`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/enum/NumberStyle.md)): Numbering style for this range

Public constructor

### PageLabel

```cpp
datalogics_interface::PageLabel::PageLabel(int start_page_index, NumberStyle style, const std::string &prefix, int first_number)
```

*constructor*

**Parameters**

- `start_page_index` (`int`): Starting page index in the Document for this range
- `style` ([`NumberStyle`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/enum/NumberStyle.md)): Numbering style for this range
- `prefix` (`const std::string &`): Prefix string for this range
- `first_number` (`int`): First number appearing on a page in this range

Public constructor

### PageLabel

```cpp
datalogics_interface::PageLabel::PageLabel(PageLabel &&) noexcept
```

*constructor*

**Parameters**

- (unnamed) ([`PageLabel &&`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/PageLabel.md))

### ~PageLabel

```cpp
datalogics_interface::PageLabel::~PageLabel()
```

*destructor*

## Methods

### get_end_page_index

```cpp
int datalogics_interface::PageLabel::get_end_page_index() const
```

**Returns:** `int`

The zero-based ending page index for this page label range.

You cannot set the end index for a range; you must change the start index for the following range. A value of -1 means the end index for this PageLabel is unknown (e.g. when the label has not yet been added to a Document).

### get_first_number_in_range

```cpp
int datalogics_interface::PageLabel::get_first_number_in_range() const
```

**Returns:** `int`

The first numeric value used for page labels in this range.

Must be greater than or equal to 1.

### get_number_style

```cpp
NumberStyle datalogics_interface::PageLabel::get_number_style() const
```

**Returns:** [`NumberStyle`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/enum/NumberStyle.md)

The NumberStyle used for generating page labels in this range.

### get_prefix

```cpp
std::string datalogics_interface::PageLabel::get_prefix() const
```

**Returns:** `std::string`

The prefix string prepended to page labels in this range.

For example, a prefix of "A-" with decimal numbering starting at 1 would produce labels "A-1", "A-2", "A-3", etc.

### get_start_page_index

```cpp
int datalogics_interface::PageLabel::get_start_page_index() const
```

**Returns:** `int`

The zero-based starting page index for this page label range in the Document.

### operator=

```cpp
PageLabel & datalogics_interface::PageLabel::operator=(const PageLabel &other)
```

**Parameters**

- `other` ([`const PageLabel &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/PageLabel.md))

**Returns:** [`PageLabel &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/PageLabel.md)

Copy assignment.

### operator=

```cpp
PageLabel & datalogics_interface::PageLabel::operator=(PageLabel &&) noexcept
```

**Parameters**

- (unnamed) ([`PageLabel &&`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/PageLabel.md))

**Returns:** [`PageLabel &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/PageLabel.md)

### set_first_number_in_range

```cpp
void datalogics_interface::PageLabel::set_first_number_in_range(int number)
```

**Parameters**

- `number` (`int`)

**Returns:** `void`

The first numeric value used for page labels in this range.

### set_number_style

```cpp
void datalogics_interface::PageLabel::set_number_style(NumberStyle style)
```

**Parameters**

- `style` ([`NumberStyle`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/enum/NumberStyle.md))

**Returns:** `void`

The NumberStyle used for generating page labels in this range.

### set_prefix

```cpp
void datalogics_interface::PageLabel::set_prefix(const std::string &prefix)
```

**Parameters**

- `prefix` (`const std::string &`)

**Returns:** `void`

The prefix string prepended to page labels in this range.

### set_start_page_index

```cpp
void datalogics_interface::PageLabel::set_start_page_index(int index)
```

**Parameters**

- `index` (`int`): the zero-based starting page index for this page label range in the Document

**Returns:** `void`

The zero-based starting page index for this page label range in the Document.

### to_string

```cpp
std::string datalogics_interface::PageLabel::to_string() const
```

**Returns:** `std::string`

A string describing this PageLabel.

Returns a string representation of this PageLabel.

The string includes the start page, end page, number style, prefix, and first page number of this label range.
