---
title: "Read, add, modify, delete PDF page metadata in C# | Nutrient .NET SDK"
canonical_url: "https://www.nutrient.io/guides/dotnet/editor/metadata-pdf-page-label/"
md_url: "https://www.nutrient.io/guides/dotnet/editor/metadata-pdf-page-label.md"
last_updated: "2026-06-15T16:16:06.394Z"
description: "Discover how to read and edit PDF metadata including EXIF, XMP, and IPTC using C#. Step-by-step guides for effective metadata management."
---

# Read and edit PDF page label metadata using C#

### EXIF Tags

[EXIF Tags](https://www.nutrient.io/guides/dotnet/editor/metadata-exif.md)

### Page Labels

[Page Labels](https://www.nutrient.io/guides/dotnet/editor/metadata-pdf-page-label.md)

### XMP

[XMP](https://www.nutrient.io/guides/dotnet/editor/metadata-xmp.md)

### IPTC

[IPTC](https://www.nutrient.io/guides/dotnet/editor/metadata-iptc.md)

Page labels in a PDF file are metadata assigned for a page, and they’re grouped as a page label range. By default, a PDF document has only one page label range, which starts from `1`. It’s possible to add multiple page label ranges, and you can specify from which number each page label range starts.

For a cross-product overview of how PDF page labels work and how each Nutrient product handles them, refer to the [PDF page labels](https://www.nutrient.io/guides/pdf-page-labels.md) guide.

## Getting the page label

To get the page label of a PDF page, use the [`GetPageLabel` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~GetPageLabel.html) and specify the page number as its parameter.

To get the page label for all pages of a PDF document, use the following code:

### C#

```csharp

using GdPicturePDF gdpicturePDF = new GdPicturePDF();
gdpicturePDF.LoadFromFile(@"C:\temp\source.pdf");
int pageCount = gdpicturePDF.GetPageCount();
for(int i = 1; i <= pageCount; i++)
{
    // Get the page label.
    Console.WriteLine(gdpicturePDF.GetPageLabel(i));
}

```

### VB.NET

```vb

Using gdpicturePDF As GdPicturePDF = New GdPicturePDF()
    gdpicturePDF.LoadFromFile("C:\temp\source.pdf")
    Dim pageCount As Integer = gdpicturePDF.GetPageCount()
    For i = 1 To pageCount
        ' Get the page label.
        Console.WriteLine(gdpicturePDF.GetPageLabel(i))
    Next
End Using

```

#### Used methods

- [`GetPageCount`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~GetPageCount.html)

- [`GetPageLabel`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~GetPageLabel.html)

- [`LoadFromFile`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~LoadFromFile.html)

#### Related topics

- [Load a file](/guides/dotnet/load-a-file.md)

## Getting the page label range

To get the page label range of a PDF document, use the [`GetPageLabelsRange` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~GetPageLabelsRange.html). It requires the page label range index as its parameter. The [`GetPageLabelsRange` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~GetPageLabelsRange.html) returns the following values:

- `StartPage` — Value of the starting position of the page label range.

- `Style` — Style of the specified label range, which is a member of the [`PdfPageLabelStyle` enumeration](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.PdfPageLabelStyle.html).

- `Prefix` — If defined, the page label prefix.

- `NumPortion` — Value of the numeric portion of the first page label.

A PDF document can have multiple page label ranges. To get the total amount in a PDF, use the [`GetPageLabelsRangeCount` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~GetPageLabelsRangeCount.html).

Use a condition to execute the `GetPageLabelsRange` method only when the amount of page label ranges is greater than `0`, in case the PDF document doesn’t have any page label ranges set up.

To get the details of all page label ranges of a PDF document, use the following code:

### C#

```csharp

using GdPicturePDF gdpicturePDF = new GdPicturePDF();
gdpicturePDF.LoadFromFile(@"C:\temp\source.pdf");
// Get total amount of page label ranges.
int labelCount = gdpicturePDF.GetPageLabelsRangeCount();
int startPage = 0, numPortion = 0;
PdfPageLabelStyle style = 0 ;
String prefix = "";
// Execute only when there are more than zero page label ranges.
if(labelCount > 0)
{
    for (int i = 0; i < labelCount; i++)
    {
        // Get page label range details.
        gdpicturePDF.GetPageLabelsRange(i, ref startPage, ref style,
            ref prefix, ref numPortion);
        Console.WriteLine($"Page Label Range nr {i}:\nStart Page: {startPage}\n" +
            $"Prefix: {prefix}\nStyle: {style}\nNumber Portion: {numPortion}");
    }
}

```

### VB.NET

```vb

Using gdpicturePDF As GdPicturePDF = New GdPicturePDF()
    gdpicturePDF.LoadFromFile("C:\temp\source.pdf")
    ' Get total amount of page label ranges.
    Dim labelCount As Integer = gdpicturePDF.GetPageLabelsRangeCount()
    Dim startPage = 0, numPortion = 0
    Dim style As PdfPageLabelStyle = 0
    Dim prefix = ""
    ' Execute only when there are more than zero page label ranges.
    If labelCount > 0 Then
        For i = 0 To labelCount - 1
            ' Get page label range details.
            gdpicturePDF.GetPageLabelsRange(i, startPage, style, prefix, numPortion)
            Console.WriteLine($"Page Label Range nr {i}:
    Start Page: {startPage}
    " & $"Prefix: {prefix}
    Style: {style}
    Number Portion: {numPortion}")
        Next
    End If
End Using

```

#### Used methods

- [`GetPageLabelsRange`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~GetPageLabelsRange.html)

- [`GetPageLabelsRangeCount`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~GetPageLabelsRangeCount.html)

- [`LoadFromFile`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~LoadFromFile.html)

#### Related topics

- [Load a file](/guides/dotnet/load-a-file.md)

## Adding a page label range

To add a page label range to a PDF document, use the [`AddPageLabelsRange` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~AddPageLabelsRange.html). It requires the following parameters:

- `StartPage` — Value of the starting position of the page label range.

- `Style` — Style of the page label that’s a member of the [`PdfPageLabelStyle` enumeration](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.PdfPageLabelStyle.html) (such as Arabic numerals or lowercase Roman numerals).

- `Prefix` — String prefix of each page label.

- `NumPortion` — Value of the numeric portion of the first page label.

Before adding a new page label range, delete all page label ranges previously added with the [`DeletePageLabels` method](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~DeletePageLabels.html).

To add a page label range for the last three appendix pages of a PDF document, use the following code:

### C#

```csharp

using GdPicturePDF gdpicturePDF = new GdPicturePDF();
gdpicturePDF.LoadFromFile(@"C:\temp\source.pdf");
// Delete previous page label ranges.
gdpicturePDF.DeletePageLabels();
// Get total amount of pages.
int pageCount = gdpicturePDF.GetPageCount();
// Add the page label range for the appendix pages.
gdpicturePDF.AddPageLabelsRange(pageCount - 2,
    PdfPageLabelStyle.PdfPageLabelStyleDecimalArabicNumerals, "A-", 1);
// Save the PDF document.
gdpicturePDF.SaveToFile(@"C:\temp\output.pdf");

```

### VB.NET

```vb

Using gdpicturePDF As GdPicturePDF = New GdPicturePDF()
    gdpicturePDF.LoadFromFile("C:\temp\source.pdf")
    ' Delete previous page label ranges.
    gdpicturePDF.DeletePageLabels()
    ' Get total amount of pages.
    Dim pageCount As Integer = gdpicturePDF.GetPageCount()
    ' Add the page label range for the appendix pages.
    gdpicturePDF.AddPageLabelsRange(pageCount - 2,
        PdfPageLabelStyle.PdfPageLabelStyleDecimalArabicNumerals, "A-", 1)
    ' Save the PDF document.
    gdpicturePDF.SaveToFile("C:\temp\output.pdf")
End Using

```

#### Used methods

- [`AddPageLabelsRange`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~AddPageLabelsRange.html)

- [`GetPageCount`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~GetPageCount.html)

- [`LoadFromFile`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~LoadFromFile.html)

- [`SaveToFile`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~SaveToFile.html)

#### Related topics

- [Load a file](/guides/dotnet/load-a-file.md)

- [Save a file](/guides/dotnet/save-a-file.md)

## Adding multiple page label ranges

To add multiple page label ranges, use the [`AddPageLabelsRange` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~AddPageLabelsRange.html). Remember to use the [`AddPageLabelsRange` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~AddPageLabelsRange.html) from the beginning of the PDF document to the end. This way, the next executed method won’t override the previous one.

To learn more about how to use the [`AddPageLabelsRange` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~AddPageLabelsRange.html), refer to the [previous section](/guides/dotnet/editor/metadata-pdf-page-label.md#adding-a-page-label-range).

To add three page label ranges for the title, main, and appendix pages, use the following code:

### C#

```csharp

using GdPicturePDF gdpicturePDF = new GdPicturePDF();
gdpicturePDF.LoadFromFile(@"C:\temp\source.pdf");
// Delete previous page label ranges.
gdpicturePDF.DeletePageLabels();
// Get total amount of pages.
int pageCount = gdpicturePDF.GetPageCount();
// Add the page label range for the title page.
gdpicturePDF.AddPageLabelsRange(1,
    PdfPageLabelStyle.PdfPageLabelStyleUndefined, "Title Page", 0);
// Add the page label range for the main pages.
gdpicturePDF.AddPageLabelsRange(2,
    PdfPageLabelStyle.PdfPageLabelStyleDecimalArabicNumerals, "", 1);
// Add the page label range for the appendix pages.
gdpicturePDF.AddPageLabelsRange(pageCount - 2,
    PdfPageLabelStyle.PdfPageLabelStyleDecimalArabicNumerals, "A-", 1);
// Save the PDF document.
gdpicturePDF.SaveToFile(@"C:\temp\output.pdf");

```

### VB.NET

```vb

Using gdpicturePDF As GdPicturePDF = New GdPicturePDF()
    gdpicturePDF.LoadFromFile("C:\temp\source.pdf")
    ' Delete previous page label ranges.
    gdpicturePDF.DeletePageLabels()
    ' Get total amount of pages.
    Dim pageCount As Integer = gdpicturePDF.GetPageCount()
    ' Add the page label range for the title page.
    gdpicturePDF.AddPageLabelsRange(1, PdfPageLabelStyle.PdfPageLabelStyleUndefined, "Title Page", 0)
    ' Add the page label range for the main pages.
    gdpicturePDF.AddPageLabelsRange(2, PdfPageLabelStyle.PdfPageLabelStyleDecimalArabicNumerals, "", 1)
    ' Add the page label range for the appendix pages.
    gdpicturePDF.AddPageLabelsRange(pageCount - 2, PdfPageLabelStyle.PdfPageLabelStyleDecimalArabicNumerals, "A-", 1)
    ' Save the PDF document.
    gdpicturePDF.SaveToFile("C:\temp\output.pdf")
End Using

```

#### Used methods

- [`AddPageLabelsRange`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~AddPageLabelsRange.html)

- [`GetPageCount`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~GetPageCount.html)

- [`LoadFromFile`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~LoadFromFile.html)

- [`SaveToFile`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~SaveToFile.html)

#### Related topics

- [Load a file](/guides/dotnet/load-a-file.md)

- [Save a file](/guides/dotnet/save-a-file.md)

## Deleting a page label range

To delete a page label range, use the [`DeletePageLabelsRange` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~DeletePageLabelsRange.html). It only requires the page label range index.

A PDF document can have multiple page label ranges. To get the total amount in a PDF, use the [`GetPageLabelsRangeCount` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~GetPageLabelsRangeCount.html).

To delete the last page label range of a PDF document, use the following code:

### C#

```csharp

using GdPicturePDF gdpicturePDF = new GdPicturePDF();
gdpicturePDF.LoadFromFile(@"C:\temp\source.pdf");
// Get page label range count.
int rangeCount = gdpicturePDF.GetPageLabelsRangeCount();
// Delete the last page label range.
gdpicturePDF.DeletePageLabelsRange(rangeCount - 1);
gdpicturePDF.SaveToFile(@"C:\temp\output.pdf");

```

### VB.NET

```vb

Using gdpicturePDF As GdPicturePDF = New GdPicturePDF()
    gdpicturePDF.LoadFromFile("C:\temp\source.pdf")
    ' Get page label range count.
    Dim rangeCount As Integer = gdpicturePDF.GetPageLabelsRangeCount()
    ' Delete the last page label range.
    gdpicturePDF.DeletePageLabelsRange(rangeCount - 1)
    gdpicturePDF.SaveToFile("C:\temp\output.pdf")
End Using

```

#### Used methods

- [`DeletePageLabelsRange`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~DeletePageLabelsRange.html)

- [`GetPageLabelsRangeCount`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~GetPageLabelsRangeCount.html)

- [`LoadFromFile`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~LoadFromFile.html)

- [`SaveToFile`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~SaveToFile.html)

#### Related topics

- [Load a file](/guides/dotnet/load-a-file.md)

- [Save a file](/guides/dotnet/save-a-file.md)

## Modifying a page label range

To modify an existing page label range, use any of the following methods:

- [`SetPageLabelsRangeStartPage`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~SetPageLabelsRangeStartPage.html) — Changes the value of the starting position of the page label range.

- [`SetPageLabelsRangeStyle`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~SetPageLabelsRangeStyle.html) — Changes the page label style that’s a member of the [`PdfPageLabelStyle` enumeration](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.PdfPageLabelStyle.html) (such as Arabic numerals or lowercase Roman numerals).

- [`SetPageLabelsRangePrefix`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~SetPageLabelsRangePrefix.html) — Changes the string prefix of each page label.

- [`SetPageLabelsRangeNumPortion`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~SetPageLabelsRangeNumPortion.html) — Changes the value of the numeric portion of the first page label.

All methods mentioned above require the page label range index and the value of the parameter you want to change.

The code example below shows how to change all parameters of a page label range:

### C#

```csharp

using GdPicturePDF gdpicturePDF = new GdPicturePDF();
gdpicturePDF.LoadFromFile(@"C:\temp\source.pdf");
// Change the start page to `1`.
gdpicturePDF.SetPageLabelsRangeStartPage(0, 1);
// Change the style to uppercase letters.
gdpicturePDF.SetPageLabelsRangeStyle(0, PdfPageLabelStyle.PdfPageLabelStyleUppercaseLetters);
// Change the prefix to `Page `.
gdpicturePDF.SetPageLabelsRangePrefix(0, "Page ");
// Change the starting number to `5`.
gdpicturePDF.SetPageLabelsRangeNumPortion(0, 5);
gdpicturePDF.SaveToFile(@"C:\temp\output.pdf");

```

### VB.NET

```vb

Using gdpicturePDF As GdPicturePDF = New GdPicturePDF()
    gdpicturePDF.LoadFromFile("C:\temp\source.pdf")
    ' Change the start page to `1`.
    gdpicturePDF.SetPageLabelsRangeStartPage(0, 1)
    ' Change the style to uppercase letters.
    gdpicturePDF.SetPageLabelsRangeStyle(0, PdfPageLabelStyle.PdfPageLabelStyleUppercaseLetters)
    ' Change the prefix to `Page `.
    gdpicturePDF.SetPageLabelsRangePrefix(0, "Page ")
    ' Change the starting number to `5`.
    gdpicturePDF.SetPageLabelsRangeNumPortion(0, 5)
    gdpicturePDF.SaveToFile("C:\temp\output.pdf")
End Using

```

#### Used methods

- [`LoadFromFile`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~LoadFromFile.html)

- [`SaveToFile`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~SaveToFile.html)

- [`SetPageLabelsRangeNumPortion`]

- [`SetPageLabelsRangePrefix`]

- [`SetPageLabelsRangeStartPage`]

- [`SetPageLabelsRangeStyle`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~SetPageLabelsRangeStyle.html)

#### Related topics

- [Load a file](/guides/dotnet/load-a-file.md)

- [Save a file](/guides/dotnet/save-a-file.md)
---

## Related pages

- [Add an image to another image using C#](/guides/dotnet/editor/add-image-to-image.md)
- [Add an image to a PDF using C#](/guides/dotnet/editor/add-image-to-pdf.md)
- [Add text to an image using C#](/guides/dotnet/editor/add-text-to-image.md)
- [Add a page to a PDF or a TIFF image in C# .NET](/guides/dotnet/editor/add-page.md)
- [Attach a file to a PDF in C#](/guides/dotnet/editor/attach-a-file.md)
- [Add text to PDFs in C#](/guides/dotnet/editor/add-text-to-pdf.md)
- [Merge PDFs in C#](/guides/dotnet/editor/merge-or-combine.md)
- [PDF and image editor in C#.NET](/guides/dotnet/editor.md)
- [Modify EXIF metadata using C#](/guides/dotnet/editor/metadata-exif.md)
- [Edit IPTC metadata using C#](/guides/dotnet/editor/metadata-iptc.md)
- [Split PDF pages into multiple pages in C#](/guides/dotnet/editor/split.md)
- [Read and edit PDF XMP metadata using C#](/guides/dotnet/editor/metadata-xmp.md)
- [Add watermarks to PDFs and images in C#](/guides/dotnet/editor/watermark.md)

