PdfTextDecoration Class
Represents a text decoration, which is a visual ornamentation that is added to text (such as an underline).
- Inheritance:
- System.ObjectPdfTextDecoration
Constructors
PdfTextDecoration(PdfTextDecorationStyle, Boolean, Double, Nullable<PdfColor>, Nullable<Double>, PdfLineDashPattern)
Initializes a new instance of the PdfTextDecoration class.
public PdfTextDecoration(PdfTextDecorationStyle style = PdfTextDecorationStyle.Single, bool wordsOnly = false, double thickness = 1, PdfColor? color = default(PdfColor? ), double? opacity = default(double? ), PdfLineDashPattern dashPattern = default(PdfLineDashPattern))
Public Sub New(style As PdfTextDecorationStyle = PdfTextDecorationStyle.Single, wordsOnly As Boolean = False, thickness As Double = 1, color As PdfColor? = Nothing, opacity As Double? = Nothing, dashPattern As PdfLineDashPattern = Nothing)
Parameters
The text decoration style.
wordsOnly
- System.Boolean
true if there shall be no text decoration across any space character (breaking or non-breaking); otherwise, false.
thickness
- System.Double
The text decoration thickness relative to the font's recommended thickness.
color
- System.Nullable<PdfColor>
The text decoration color. If the color
is null, the text decoration color matches the text color to which it is applied.
opacity
- System.Nullable<System.Double>
The text decoration opacity. If the opacity
is null, the text decoration opacity matches the text opacity to which it is applied.
dashPattern
- PdfLineDashPattern
The text decoration dash pattern. The default value is equal to the Solid.
Exceptions
- System.ArgumentOutOfRangeException
thickness
is not greater than zero or opacity
is not null and is not between 0 and 1 inclusive.
- System.ArgumentException
The color
is not null and its Space is not device color space (DeviceGray, DeviceRGB, or DeviceCMYK).
Properties
Color
Gets the text decoration color.
Property Value
- System.Nullable<PdfColor>
The text decoration color.
Remarks
If the Color is null, the text decoration color matches the text color to which it is applied.
The Color doesn't affect the underline span calculation.
DashPattern
Gets the text decoration dash pattern.
public PdfLineDashPattern DashPattern { get; }
Public ReadOnly Property DashPattern As PdfLineDashPattern
Property Value
The text decoration dash pattern.
See Also
Opacity
Gets the text decoration opacity.
Property Value
- System.Nullable<System.Double>
The text decoration opacity.
Remarks
If the Opacity is null, the text decoration opacity matches the text opacity to which it is applied.
The Opacity doesn't affect the underline span calculation.
Style
Gets the text decoration style.
public PdfTextDecorationStyle Style { get; }
Public ReadOnly Property Style As PdfTextDecorationStyle
Property Value
The text decoration style.
Thickness
Gets the text decoration thickness relative to the font's recommended thickness.
Property Value
- System.Double
The text decoration thickness relative to the font's recommended thickness.
WordsOnly
Gets a value indicating whether there shall be no text decoration across any space character (breaking or non-breaking).
Property Value
- System.Boolean
true if there shall be no text decoration across any space character (breaking or non-breaking); otherwise, false.
Methods
ToString()
Returns a System.String that represents this PdfTextDecoration instance.
Returns
- System.String
A System.String that represents this PdfTextDecoration instance.
Overrides
Remarks
This method should be used primarily for debugging purposes and should be considered volatile (format of its return value might change in future versions).