---
Product: Aspose.PDF
Platform: net
Page Type: reference
Canonical URL: https://reference.aspose.org/pdf/net/PageNumberStamp
---

# PageNumberStamp

## Overview

`PageNumberStamp` is a class in Aspose.PDF FOSS for .NET.
Inherits from: `Aspose.Pdf.Stamps.Stamp`.

A stamp that adds page numbers to PDF pages.

This class provides 1 method for working with PageNumberStamp objects in .NET programs.
Available methods include: `ApplyToAll`.
All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package.
Properties: `Background`, `BottomMargin`, `Color`, `FontName`, `FontSize`, `Format`, and 14 more.

## Properties

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `Format` | `string` | Read/Write | Page number format. |
| `StartingNumber` | `int` | Read/Write | Starting page number. |
| `FontName` | `string` | Read/Write | Font name. |
| `FontSize` | `double` | Read/Write | Font size in points. |
| `TextState` | `TextState` | Read | Text state for the page number; setting TextState.FontSize updates the stamp's FontSize on the next stamp emission. |
| `Color` | `(double R, double G, double B)` | Read/Write | Text color as RGB (0-1 range). |
| `StampId` | `int` | Read/Write | Optional identifier embedded as a %StampId content-stream comment when the stamp is applied, so PdfContentEditor.GetStamps / DeleteStampById can find it later. |
| `XIndent` | `double` | Read/Write | X position on the page. |
| `YIndent` | `double` | Read/Write | Y position on the page. |
| `Rotate` | `Rotation` | Read/Write | Rotation (0, 90, 180, 270). |
| `RotateAngle` | `double` | Read/Write | Arbitrary rotation angle in degrees. |
| `Opacity` | `double` | Read/Write | Opacity (0.0 = transparent, 1.0 = opaque). |
| `IsBackground` | `bool` | Read/Write | Whether the stamp is drawn behind page content. |
| `Background` | `bool` | Read/Write | Alias for IsBackground. |
| `TopMargin` | `double` | Read/Write | Top margin offset in points. |
| `BottomMargin` | `double` | Read/Write | Bottom margin offset in points. |
| `LeftMargin` | `double` | Read/Write | Left margin offset in points. |
| `RightMargin` | `double` | Read/Write | Right margin offset in points. |
| `HorizontalAlignment` | `HorizontalAlignment` | Read/Write | Horizontal alignment. |
| `VerticalAlignment` | `VerticalAlignment` | Read/Write | Vertical alignment. |

## Methods

| Signature | Description |
|-----------|-------------|
| `ApplyToAll(document: Document)` | Apply this stamp to all pages in the document. |

## See Also

- [Aspose.PDF for .NET — Enterprise API Reference](https://reference.aspose.com/pdf/net/)