Class ParagraphIndentation
Represents the indentation settings applied to a paragraph in a Word document.
Inheritance
Implements
Namespace: IronWord.Models
Assembly: IronWord.dll
Syntax
public class ParagraphIndentation : Object
Indenting a paragraph in a Word document, whether a left margin, a first-line indent, or a hanging indent for a list, is configured through ParagraphIndentation. It collects every indentation measurement that applies to a paragraph so a style can set how far the text sits from the edges and how the first line behaves relative to the rest.
A developer reaches it through a paragraph's style: ParagraphStyle exposes an Indentation property of this type, so indentation lives with the rest of the style and applies to every paragraph carrying it. Set the values you need on this object, leaving the others unset, then apply the owning style.
The members group by what they indent. Edges: Left and Right (with their logical counterparts Start and End, which respect text direction) push the whole paragraph in from the sides. Line shape: FirstLine indents only the opening line, and Hanging indents every line except the first, the pattern behind bulleted and numbered text. Character units: each measurement has a *Chars companion (LeftChars, FirstLineChars, HangingChars, and so on) for indentation expressed in character widths instead of physical units. Setting and reading: the Set methods take a nullable value and a MeasurementUnit, and the matching Get methods read a value back in the unit you request; Clone copies the whole set when you want to reuse one paragraph's indentation on another.
var indentation = new ParagraphIndentation();
indentation.SetFirstLine(1.0, MeasurementUnit.Centimeter);
paragraphStyle.Indentation = indentation;The add style text how-to covers paragraph styling, and the document element tutorial explains how paragraphs and styles fit together.
Constructors
ParagraphIndentation()
Declaration
public ParagraphIndentation()
Properties
End
Gets or sets the ending indentation for the paragraph.
Declaration
public Nullable<double> End { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Double> |
EndCharacters
Gets or sets the number of characters to indent at the end of the paragraph.
Declaration
public Nullable<double> EndCharacters { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Double> |
FirstLine
Gets or sets the indentation for the first line of the paragraph.
Declaration
public Nullable<double> FirstLine { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Double> |
FirstLineChars
Gets or sets the number of characters to indent for the first line of the paragraph.
Declaration
public Nullable<double> FirstLineChars { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Double> |
Hanging
Gets or sets the hanging indentation for the paragraph.
Declaration
public Nullable<double> Hanging { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Double> |
HangingChars
Gets or sets the number of characters in a hanging indent for the paragraph.
Declaration
public Nullable<double> HangingChars { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Double> |
Left
Gets or sets the left indentation for the paragraph.
Declaration
public Nullable<double> Left { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Double> |
LeftChars
Gets or sets the number of characters to indent on the left side of the paragraph.
Declaration
public Nullable<double> LeftChars { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Double> |
Right
Gets or sets the right indentation for the paragraph.
Declaration
public Nullable<double> Right { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Double> |
RightChars
Gets or sets the number of characters to indent on the right side of the paragraph.
Declaration
public Nullable<double> RightChars { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Double> |
Start
Gets or sets the starting indentation for the paragraph.
Declaration
public Nullable<double> Start { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Double> |
StartCharacters
Gets or sets the number of characters to indent at the beginning of the paragraph.
Declaration
public Nullable<double> StartCharacters { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Double> |
Methods
Clone()
Declaration
public object Clone()
Returns
| Type | Description |
|---|---|
| System.Object |
GetEnd(MeasurementUnit)
Gets the ending indentation for the paragraph.
Declaration
public Nullable<double> GetEnd(MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| MeasurementUnit | measurementUnit | The measurement unit to convert to (default is Twips). |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Double> | The ending indentation in the specified measurement unit. |
GetEndCharacters(MeasurementUnit)
Gets the number of characters to indent at the end of the paragraph.
Declaration
public Nullable<double> GetEndCharacters(MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| MeasurementUnit | measurementUnit | The measurement unit to convert to (default is Twips). |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Double> | The number of characters to indent at the end of the paragraph in the specified measurement unit. |
GetFirstLine(MeasurementUnit)
Gets the indentation for the first line of the paragraph.
Declaration
public Nullable<double> GetFirstLine(MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| MeasurementUnit | measurementUnit | The measurement unit to convert to (default is Twips). |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Double> | The indentation for the first line of the paragraph in the specified measurement unit. |
GetFirstLineChars(MeasurementUnit)
Gets the number of characters to indent for the first line of the paragraph.
Declaration
public Nullable<double> GetFirstLineChars(MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| MeasurementUnit | measurementUnit | The measurement unit to convert to (default is Twips). |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Double> | The number of characters to indent for the first line of the paragraph in the specified measurement unit. |
GetHanging(MeasurementUnit)
Gets the hanging indentation for the paragraph.
Declaration
public Nullable<double> GetHanging(MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| MeasurementUnit | measurementUnit | The measurement unit to convert to (default is Twips). |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Double> | The hanging indentation in the specified measurement unit. |
GetHangingChars(MeasurementUnit)
Gets the number of characters in a hanging indent for the paragraph.
Declaration
public Nullable<double> GetHangingChars(MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| MeasurementUnit | measurementUnit | The measurement unit to convert to (default is Twips). |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Double> | The number of characters in a hanging indent for the paragraph in the specified measurement unit. |
GetLeft(MeasurementUnit)
Gets the left indentation for the paragraph.
Declaration
public Nullable<double> GetLeft(MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| MeasurementUnit | measurementUnit | The measurement unit to convert to (default is Twips). |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Double> | The left indentation in the specified measurement unit. |
GetLeftChars(MeasurementUnit)
Gets the number of characters to indent on the left side of the paragraph.
Declaration
public Nullable<double> GetLeftChars(MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| MeasurementUnit | measurementUnit | The measurement unit to convert to (default is Twips). |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Double> | The number of characters to indent on the left side of the paragraph in the specified measurement unit. |
GetRight(MeasurementUnit)
Gets the right indentation for the paragraph.
Declaration
public Nullable<double> GetRight(MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| MeasurementUnit | measurementUnit | The measurement unit to convert to (default is Twips). |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Double> | The right indentation in the specified measurement unit. |
GetRightChars(MeasurementUnit)
Gets the number of characters to indent on the right side of the paragraph.
Declaration
public Nullable<double> GetRightChars(MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| MeasurementUnit | measurementUnit | The measurement unit to convert to (default is Twips). |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Double> | The number of characters to indent on the right side of the paragraph in the specified measurement unit. |
GetStart(MeasurementUnit)
Gets the starting indentation for the paragraph.
Declaration
public Nullable<double> GetStart(MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| MeasurementUnit | measurementUnit | The measurement unit to convert to (default is Twips). |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Double> | The starting indentation in the specified measurement unit. |
GetStartCharacters(MeasurementUnit)
Gets the number of characters to indent at the beginning of the paragraph.
Declaration
public Nullable<double> GetStartCharacters(MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| MeasurementUnit | measurementUnit | The measurement unit to convert to (default is Twips). |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Double> | The number of characters to indent at the beginning of the paragraph in the specified measurement unit. |
SetEnd(Nullable<Double>, MeasurementUnit)
Sets the ending indentation for the paragraph.
Declaration
public void SetEnd(Nullable<double> end, MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.Double> | end | The ending indentation value. |
| MeasurementUnit | measurementUnit | The measurement unit for the indentation. |
SetEndCharacters(Nullable<Double>, MeasurementUnit)
Sets the number of characters to indent at the end of the paragraph.
Declaration
public void SetEndCharacters(Nullable<double> endCharacters, MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.Double> | endCharacters | The number of characters to indent. |
| MeasurementUnit | measurementUnit | The measurement unit for the indentation. |
SetFirstLine(Nullable<Double>, MeasurementUnit)
Sets the indentation for the first line of the paragraph.
Declaration
public void SetFirstLine(Nullable<double> firstLine, MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.Double> | firstLine | The first line indentation value. |
| MeasurementUnit | measurementUnit | The measurement unit for the indentation. |
SetFirstLineChars(Nullable<Double>, MeasurementUnit)
Sets the number of characters to indent for the first line of the paragraph.
Declaration
public void SetFirstLineChars(Nullable<double> firstLineChars, MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.Double> | firstLineChars | The number of characters to indent. |
| MeasurementUnit | measurementUnit | The measurement unit for the indentation. |
SetHanging(Nullable<Double>, MeasurementUnit)
Sets the hanging indentation for the paragraph.
Declaration
public void SetHanging(Nullable<double> hanging, MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.Double> | hanging | The hanging indentation value. |
| MeasurementUnit | measurementUnit | The measurement unit for the indentation. |
SetHangingChars(Nullable<Double>, MeasurementUnit)
Sets the number of characters in a hanging indent for the paragraph.
Declaration
public void SetHangingChars(Nullable<double> hangingChars, MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.Double> | hangingChars | The number of characters to indent. |
| MeasurementUnit | measurementUnit | The measurement unit for the indentation. |
SetLeft(Nullable<Double>, MeasurementUnit)
Sets the left indentation for the paragraph.
Declaration
public void SetLeft(Nullable<double> left, MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.Double> | left | The left indentation value. |
| MeasurementUnit | measurementUnit | The measurement unit for the indentation. |
SetLeftChars(Nullable<Double>, MeasurementUnit)
Sets the number of characters to indent on the left side of the paragraph.
Declaration
public void SetLeftChars(Nullable<double> leftChars, MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.Double> | leftChars | The number of characters to indent. |
| MeasurementUnit | measurementUnit | The measurement unit for the indentation. |
SetRight(Nullable<Double>, MeasurementUnit)
Sets the right indentation for the paragraph.
Declaration
public void SetRight(Nullable<double> right, MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.Double> | right | The right indentation value. |
| MeasurementUnit | measurementUnit | The measurement unit for the indentation. |
SetRightChars(Nullable<Double>, MeasurementUnit)
Sets the number of characters to indent on the right side of the paragraph.
Declaration
public void SetRightChars(Nullable<double> rightChars, MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.Double> | rightChars | The number of characters to indent. |
| MeasurementUnit | measurementUnit | The measurement unit for the indentation. |
SetStart(Nullable<Double>, MeasurementUnit)
Sets the starting indentation for the paragraph.
Declaration
public void SetStart(Nullable<double> start, MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.Double> | start | The starting indentation value. |
| MeasurementUnit | measurementUnit | The measurement unit for the indentation. |
SetStartCharacters(Nullable<Double>, MeasurementUnit)
Sets the number of characters to indent at the beginning of the paragraph.
Declaration
public void SetStartCharacters(Nullable<double> startCharacters, MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.Double> | startCharacters | The number of characters to indent. |
| MeasurementUnit | measurementUnit | The measurement unit for the indentation. |