PageNumberStamp
Overview
PageNumberStamp is a class in Aspose.PDF FOSS for .NET.
Inherits from: Stamp.
A stamp that adds page numbers to PDF pages.
This class declares 12 methods for PageNumberStamp objects in .NET programs.
Available methods include: ApplyToAll, BindImage, BindLogo, BindPdf, BindTextState, PageNumberStamp, SetImageSize, SetOrigin, Stamp.
Public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package.
Properties: BlendingSpace, Color, FontName, FontSize, Format, IsBackground, and 10 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 | The stamp identifier. |
Pages | int[]? | Read/Write | Pages to apply the stamp to (1-based). |
PageNumber | int | Read/Write | Single page number to apply the stamp to (1-based). |
XOrigin | double | Read/Write | X origin position in points. |
YOrigin | double | Read/Write | Y origin position in points. |
Rotation | float | Read/Write | Rotation angle in degrees. |
Opacity | float | Read/Write | Opacity (0.0-1.0). |
IsBackground | bool | Read/Write | Whether this stamp is in the background. |
Quality | int | Read/Write | JPEG quality (1..100) when the stamp is emitted as a JPEG image. |
BlendingSpace | BlendingColorSpace | Read/Write | Blending colour space used when compositing the stamp onto the page. |
Methods
| Signature | Description |
|---|---|
PageNumberStamp() | Creates a page-number stamp with the default format “Page {0} of {1}”, starting at 1, in 10-point Helvetica. |
ApplyToAll(document: Document) | Apply this stamp to all pages in the document. |
Stamp() | Creates an empty stamp with full opacity and no content; bind a logo, image or PDF page before adding it. |
BindLogo(formattedText: FormattedText) | Bind a FormattedText as the stamp’s logo (text stamp). |
BindImage(imageData: byte[]) | Bind raw image bytes as the stamp’s logo (image stamp). |
BindImage(image: Stream) | Bind a stream as the stamp’s image source. |
BindImage(imageFile: string) | Bind a file path as the stamp’s image source. |
BindPdf(pdfStream: Stream, pageNumber: int) | Bind a PDF page (as the stamp source) by stream + 1-based page number. |
BindPdf(pdfFile: string, pageNumber: int) | Bind a PDF page (as the stamp source) by file path + 1-based page number. |
BindTextState(textState: TextState) | Bind a TextState that overrides defaults when the stamp is text-typed. |
SetImageSize(width: float, height: float) | Set the explicit pixel size at which the image stamp is rendered. |
SetOrigin(originX: float, originY: float) | Set the origin position. |