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

    Show / Hide Table of Contents

    ParagraphFormat Class

    Namespace:
    GemBox.Document
    Assembly:
    GemBox.Document.dll

    Represents a set of paragraph formatting properties which shall be applied to the contents of the parent paragraph.

    • C#
    • VB.NET
    public sealed class ParagraphFormat : Format
    Public NotInheritable Class ParagraphFormat
        Inherits Format
    Inheritance:
    System.Object
    Format
    ParagraphFormat
    Remarks

    GemBox.Document supports a variety of paragraph formatting options like alignment, borders, spacing, indentation, tabs and many others.

    ParagraphFormat can be set on:
    • Paragraph element;
    • ParagraphStyle style;
    • DefaultParagraphFormat property.

    For more information about ParagraphFormat properties, see paragraph formatting example.

    Constructors

    ParagraphFormat()

    Initializes a new instance of the ParagraphFormat class.

    • C#
    • VB.NET
    public ParagraphFormat()
    Public Sub New

    Properties

    Alignment

    Gets or sets the text alignment for the paragraph.

    • C#
    • VB.NET
    public HorizontalAlignment Alignment { get; set; }
    Public Property Alignment As HorizontalAlignment
    Property Value
    HorizontalAlignment

    The text alignment for the paragraph.

    Remarks

    If RightToLeft or RightToLeft are true, Left will be rendered as Right and Right will be rendered as Left.

    AutoSpaceEastAsianTextAndLatin

    Gets or sets a value indicating whether inter-character spacing shall automatically be adjusted between regions of Latin text and regions of East Asian text in the current paragraph. These regions shall be determined by the Unicode character values of the text content within the paragraph.

    • C#
    • VB.NET
    public bool AutoSpaceEastAsianTextAndLatin { get; set; }
    Public Property AutoSpaceEastAsianTextAndLatin As Boolean
    Property Value
    System.Boolean

    true if inter-character spacing shall automatically be adjusted between regions of Latin text and regions of East Asian text in the current paragraph; otherwise, false.

    AutoSpaceEastAsianTextAndNumbers

    Gets or sets a value indicating whether inter-character spacing shall automatically be adjusted between regions of numbers and regions of East Asian text in the current paragraph. These regions shall be determined by the Unicode character values of the text content within the paragraph.

    • C#
    • VB.NET
    public bool AutoSpaceEastAsianTextAndNumbers { get; set; }
    Public Property AutoSpaceEastAsianTextAndNumbers As Boolean
    Property Value
    System.Boolean

    true if inter-character spacing shall automatically be adjusted between regions of numbers and regions of East Asian text in the current paragraph; otherwise, false.

    BackgroundColor

    Gets or sets the paragraph background color.

    • C#
    • VB.NET
    public Color BackgroundColor { get; set; }
    Public Property BackgroundColor As Color
    Property Value
    Color

    The background color.

    Borders

    Gets the paragraph borders.

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

    The paragraph borders.

    See Also
    SingleBorder
    MultipleBorders

    KeepLinesTogether

    When true, all lines for this paragraph are maintained on a single page whenever possible.

    • C#
    • VB.NET
    public bool KeepLinesTogether { get; set; }
    Public Property KeepLinesTogether As Boolean
    Property Value
    System.Boolean

    true if all lines for this paragraph are maintained on a single page; otherwise, false.

    KeepWithNext

    When true, the paragraph is on the same page as the following paragraph whenever possible.

    • C#
    • VB.NET
    public bool KeepWithNext { get; set; }
    Public Property KeepWithNext As Boolean
    Property Value
    System.Boolean

    true when keep with next paragraph; otherwise, false.

    LeftIndentation

    Gets or sets (in points) the left indentation for the paragraph.

    • C#
    • VB.NET
    public double LeftIndentation { get; set; }
    Public Property LeftIndentation As Double
    Property Value
    System.Double

    The left indentation in points.

    LineSpacing

    Gets or sets the line spacing.

    • C#
    • VB.NET
    public double LineSpacing { get; set; }
    Public Property LineSpacing As Double
    Property Value
    System.Double

    The line spacing.

    Remarks

    If LineSpacingRule is Multiple then this value is in the number of lines, otherwise it is in the points.

    LineSpacingRule

    Gets or sets the line spacing rule.

    • C#
    • VB.NET
    public LineSpacingRule LineSpacingRule { get; set; }
    Public Property LineSpacingRule As LineSpacingRule
    Property Value
    LineSpacingRule

    The line spacing rule.

    MirrorIndents

    Gets or sets whether the paragraph indents should be interpreted as mirrored indents.

    • C#
    • VB.NET
    public bool MirrorIndents { get; set; }
    Public Property MirrorIndents As Boolean
    Property Value
    System.Boolean

    true if paragraph indents should be interpreted as mirrored indents; otherwise, false.

    Remarks

    When this property is true then the left indent shall become the inside indent and the right indent shall become the outside indent.

    NoSpaceBetweenParagraphsOfSameStyle

    When true, spacing between paragraphs with the same style will be ignored.

    • C#
    • VB.NET
    public bool NoSpaceBetweenParagraphsOfSameStyle { get; set; }
    Public Property NoSpaceBetweenParagraphsOfSameStyle As Boolean
    Property Value
    System.Boolean

    true if spacing between paragraphs with the same style will be ignored; otherwise, false.

    OutlineLevel

    Gets or sets the outline level.

    • C#
    • VB.NET
    public OutlineLevel OutlineLevel { get; set; }
    Public Property OutlineLevel As OutlineLevel
    Property Value
    OutlineLevel

    The outline level.

    PageBreakBefore

    When true, this paragraph is rendered on the start of a new page in the document.

    • C#
    • VB.NET
    public bool PageBreakBefore { get; set; }
    Public Property PageBreakBefore As Boolean
    Property Value
    System.Boolean

    true if page break needs to be added before paragraph; otherwise, false.

    RightIndentation

    Gets or sets (in points) the right indentation for the paragraph.

    • C#
    • VB.NET
    public double RightIndentation { get; set; }
    Public Property RightIndentation As Double
    Property Value
    System.Double

    The right indentation in points.

    RightToLeft

    When true, this is a right-to-left paragraph.

    • C#
    • VB.NET
    public bool RightToLeft { get; set; }
    Public Property RightToLeft As Boolean
    Property Value
    System.Boolean

    true if this is right-to-left paragraph; otherwise, false.

    SpaceAfter

    Gets or sets the amount of spacing after the paragraph (in points).

    • C#
    • VB.NET
    public double SpaceAfter { get; set; }
    Public Property SpaceAfter As Double
    Property Value
    System.Double

    The space after.

    SpaceBefore

    Gets or sets the amount of spacing before the paragraph (in points).

    • C#
    • VB.NET
    public double SpaceBefore { get; set; }
    Public Property SpaceBefore As Double
    Property Value
    System.Double

    The space before.

    SpecialIndentation

    Gets or sets the special indentation for the paragraph.

    • C#
    • VB.NET
    public double SpecialIndentation { get; set; }
    Public Property SpecialIndentation As Double
    Property Value
    System.Double

    The special indentation in points.

    Remarks

    This values is positive for Hanging indentation and it's negative for First line indentation.

    Style

    Gets or sets the style.

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

    The style.

    SuppressLineNumbers

    Gets or sets a value indicating whether the line numbers should be suppressed for the paragraph.

    • C#
    • VB.NET
    public bool SuppressLineNumbers { get; set; }
    Public Property SuppressLineNumbers As Boolean
    Property Value
    System.Boolean

    true, if line numbers should be suppressed; otherwise, false.

    Tabs

    Gets the TabStops collection.

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

    The TabStops collection.

    Remarks

    Creating customized tabs in a document is accomplished with TabStop structure that enables you to define tab position, tab leader character and surrounding text alignment.

    TabStops should be inserted into Tabs collection to be used in a Paragraph.

    Tabs are inserted into a document content with SpecialCharacter elements that have CharacterType property equal to Tab.

    Values Bar and List are currently not supported in PDF, XPS and image file formats.

    See Also
    TabStop
    TabStopCollection
    SpecialCharacter

    WidowControl

    When true, this will prevent a single line of the paragraph from being displayed on a separate page from the remaining content.

    • C#
    • VB.NET
    public bool WidowControl { get; set; }
    Public Property WidowControl As Boolean
    Property Value
    System.Boolean

    true if single line will be prevented from displaying on a separate page from the remaining content; otherwise, false.

    WordWrap

    Gets or sets a value indicating whether to break text which exceeds the text extents of a line by moving the word to the new line or breaking the word on the character level.

    • C#
    • VB.NET
    public bool WordWrap { get; set; }
    Public Property WordWrap As Boolean
    Property Value
    System.Boolean

    true, to break text on the word level; false to break text on the character level.

    Methods

    ClearFormatting()

    Clears the formatting.

    • C#
    • VB.NET
    public override void ClearFormatting()
    Public Overrides Sub ClearFormatting
    Overrides
    Format.ClearFormatting()
    Remarks

    This method will clear all directly set formatting values. When retrieving formatting value, they can still come from other sources, as explained in formats and styles article.

    Clone()

    Clones this ParagraphFormat instance.

    • C#
    • VB.NET
    public ParagraphFormat Clone()
    Public Function Clone As ParagraphFormat
    Returns
    ParagraphFormat

    Cloned ParagraphFormat.

    Clone(Boolean)

    Clones this ParagraphFormat instance.

    • C#
    • VB.NET
    public ParagraphFormat Clone(bool resolveValues)
    Public Function Clone(resolveValues As Boolean) As ParagraphFormat
    Parameters
    resolveValues
    System.Boolean

    If true, the values to be cloned will be fetched from this object's resolved values. This means that even if a property was never explicitly set, this method will look into this format style or in the document's default formats to resolve the values and explicitly set them in the cloned object.

    Returns
    ParagraphFormat

    Cloned ParagraphFormat.

    Equals(Object)

    Determines whether the specified System.Object is equal to this ParagraphFormat instance.

    • C#
    • VB.NET
    public override bool Equals(object obj)
    Public Overrides Function Equals(obj As Object) As Boolean
    Parameters
    obj
    System.Object

    The System.Object to compare with this paragraph format instance.

    Returns
    System.Boolean

    true if the specified System.Object is a ParagraphFormat and is equal to this ParagraphFormat instance; otherwise, false.

    Overrides
    System.Object.Equals(System.Object)

    GetHashCode()

    Returns a hash code for this ParagraphFormat instance.

    • C#
    • VB.NET
    public override int GetHashCode()
    Public Overrides Function GetHashCode As Integer
    Returns
    System.Int32

    An integer value that specifies a hash value for this ParagraphFormat instance.

    Overrides
    System.Object.GetHashCode()

    Operators

    Equality(ParagraphFormat, ParagraphFormat)

    Determines whether first and second ParagraphFormats are equal.

    • C#
    • VB.NET
    public static bool operator ==(ParagraphFormat first, ParagraphFormat second)
    Public Shared Operator =(first As ParagraphFormat, second As ParagraphFormat) As Boolean
    Parameters
    first
    ParagraphFormat

    The first paragraph format.

    second
    ParagraphFormat

    The second paragraph format.

    Returns
    System.Boolean

    true if first and second paragraph formats are equal; otherwise, false.

    Inequality(ParagraphFormat, ParagraphFormat)

    Determines whether first and second ParagraphFormats are not equal.

    • C#
    • VB.NET
    public static bool operator !=(ParagraphFormat first, ParagraphFormat second)
    Public Shared Operator <>(first As ParagraphFormat, second As ParagraphFormat) As Boolean
    Parameters
    first
    ParagraphFormat

    The first paragraph format.

    second
    ParagraphFormat

    The second paragraph format.

    Returns
    System.Boolean

    true if first and second paragraph formats are not equal; otherwise, false.

    Inherited Properties

    Document

    Gets the owner document.

    (Inherited from Format)

    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.