GemBox.Pdf
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    PdfTextDecoration Class

    Namespace:
    GemBox.Pdf.Content
    Assembly:
    GemBox.Pdf.dll

    Represents a text decoration, which is a visual ornamentation that is added to text (such as an underline).

    • C#
    • VB.NET
    public sealed class PdfTextDecoration
    Public NotInheritable Class PdfTextDecoration
    Inheritance:
    System.Object
    PdfTextDecoration

    Constructors

    PdfTextDecoration(PdfTextDecorationStyle, Boolean, Double, Nullable<PdfColor>, Nullable<Double>, PdfLineDashPattern)

    Initializes a new instance of the PdfTextDecoration class.

    • C#
    • VB.NET
    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
    style
    PdfTextDecorationStyle

    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.

    • C#
    • VB.NET
    public PdfColor? Color { get; }
    Public ReadOnly Property Color As PdfColor?
    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.

    • C#
    • VB.NET
    public PdfLineDashPattern DashPattern { get; }
    Public ReadOnly Property DashPattern As PdfLineDashPattern
    Property Value
    PdfLineDashPattern

    The text decoration dash pattern.

    See Also
    PDF Specification ISO 32000-1:2008, section '8.4.3.6 Line Dash Pattern'

    Opacity

    Gets the text decoration opacity.

    • C#
    • VB.NET
    public double? Opacity { get; }
    Public ReadOnly Property Opacity As Double?
    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.

    • C#
    • VB.NET
    public PdfTextDecorationStyle Style { get; }
    Public ReadOnly Property Style As PdfTextDecorationStyle
    Property Value
    PdfTextDecorationStyle

    The text decoration style.

    Thickness

    Gets the text decoration thickness relative to the font's recommended thickness.

    • C#
    • VB.NET
    public double Thickness { get; }
    Public ReadOnly Property Thickness As Double
    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).

    • C#
    • VB.NET
    public bool WordsOnly { get; }
    Public ReadOnly Property WordsOnly As Boolean
    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.

    • C#
    • VB.NET
    public override string ToString()
    Public Overrides Function ToString As String
    Returns
    System.String

    A System.String that represents this PdfTextDecoration instance.

    Overrides
    System.Object.ToString()
    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).

    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.