TextStamp
Overview
TextStamp is a class in Aspose.PDF FOSS for .NET.
Inherits from: Stamp.
A text stamp that can be applied to PDF pages.
This class provides 8 methods for working with TextStamp objects in .NET programs.
Available methods include: BindImage, BindLogo, BindPdf, BindTextState, SetImageSize, SetOrigin, TextStamp.
All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package.
Properties: BlendingSpace, Color, DefaultFont, DefaultFontSize, FontName, FontSize, and 19 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
DefaultFont | Font | Read | Default font used when FontName is not set explicitly. |
DefaultFontSize | float | Read | Default font size used when FontSize is not set explicitly. |
Text | string | Read/Write | The text to stamp. |
Value | string | Read/Write | Alias for Text. |
FontName | string | Read/Write | Font name (must exist in page resources or be a Standard 14 font). |
FontSize | float | Read | Font size in points. |
Color | Color | Read/Write | Text color. |
TextState | TextState | Read/Write | Text formatting state. |
WordWrap | bool | Read/Write | Whether to wrap text at Width boundary. |
WordWrapMode | TextFormattingOptions.WordWrapMode | Read/Write | Word-wrap mode applied to the stamp text. |
Width | double | Read/Write | Width constraint used for word wrapping (in points). |
Height | double | Read/Write | Height constraint for the stamp box. |
Scale | bool | Read/Write | When true, the stamp text is scaled to fit Width × Height. |
Zoom | double | Read/Write | Zoom factor applied to the stamp. |
TextAlignment | HorizontalAlignment | Read/Write | Horizontal alignment of the text lines inside the stamp box. |
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 |
|---|---|
TextStamp(text: string) | Calls TextStamp on this TextStamp instance. |
TextStamp(formattedText: FormattedText) | Create a TextStamp from a FormattedText (flattens its lines to a single string, joined by ‘\n’). |
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). |
BindPdf(pdfStream: Stream, pageNumber: int) | Bind a PDF page (as the stamp source) by stream + 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. |