Class TextStamper
This allows the user to edit an existing PDF by adding some stamped text.
A subclass of Stamper. Defines a Text PDF Stamper. Can be applied with: ApplyStamp(Stamper)To see usage and an example of TextStamper, visit: https://ironpdf.com/tutorials/csharp-edit-pdf-complete-tutorial/#stamp-text-onto-a-pdf
Inherited Members
Namespace: IronPdf.Editing
Assembly: IronPdf.dll
Syntax
public class TextStamper : Stamper
  Constructors
TextStamper(Int32)
Initializes a new instance of the TextStamper class. This will also automatically wait for all fonts to be loaded before rendering.
Declaration
public TextStamper(int maxWaitTime = 10000)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | maxWaitTime | Maximum wait time to wait for all fonts to be loaded before rendering. Default value is 10,000 ms or 10 seconds.  | 
      
TextStamper(String, Int32)
Initializes a new instance of the TextStamper class. This will also automatically wait for all fonts to be loaded before rendering.
Declaration
public TextStamper(string text, int maxWaitTime = 10000)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | text | The text to be stamped by the Stamper  | 
      
| System.Int32 | maxWaitTime | Maximum wait time to wait for all fonts to be loaded before rendering. Default value is 10,000 ms or 10 seconds.  | 
      
Properties
BackgroundColor
Background Color. Default is transparent.
Declaration
public Color BackgroundColor { get; set; }
  Property Value
| Type | Description | 
|---|---|
| IronSoftware.Drawing.Color | 
Color
Font Color. Default is black.
Declaration
public Color Color { get; set; }
  Property Value
| Type | Description | 
|---|---|
| IronSoftware.Drawing.Color | 
FontFamily
Font family name for the text.
Note: If using a web font from https://fonts.google.com/ then you must set UseGoogleFont property of this TextStamper to true.Declaration
public string FontFamily { get; set; }
  Property Value
| Type | Description | 
|---|---|
| System.String | 
FontSize
Font size in px
Declaration
public int FontSize { get; set; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
IsBold
Determines if the bold font weight is applied
Declaration
public bool IsBold { get; set; }
  Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
IsItalic
Determines if the text has the italic font style applied
Declaration
public bool IsItalic { get; set; }
  Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
IsStrikethrough
Determines if the text has a strike-through applied
Declaration
public bool IsStrikethrough { get; set; }
  Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
IsUnderline
Determines if the text has an underline font style applied
Declaration
public bool IsUnderline { get; set; }
  Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
Text
The text to be stamped by the Stamper
Declaration
public string Text { get; set; }
  Property Value
| Type | Description | 
|---|---|
| System.String | 
UseGoogleFont
Must be set to true, when using FontFamily from https://fonts.google.com/ as a web font
Declaration
public bool UseGoogleFont { get; set; }
  Property Value
| Type | Description | 
|---|---|
| System.Boolean |