com.aspose.words
Class ParagraphFormat

java.lang.Object
    extended by com.aspose.words.ParagraphFormat

public class ParagraphFormat 
extends java.lang.Object

Represents all the formatting for a paragraph.

Property Getters/Setters Summary
booleangetAddSpaceBetweenFarEastAndAlpha()
voidsetAddSpaceBetweenFarEastAndAlpha(boolean value)
           Gets or sets a flag indicating whether inter-character spacing is automatically adjusted between regions of Latin text and regions of East Asian text in the current paragraph.
booleangetAddSpaceBetweenFarEastAndDigit()
voidsetAddSpaceBetweenFarEastAndDigit(boolean value)
           Gets or sets a flag indicating whether inter-character spacing is automatically adjusted between regions of numbers and regions of East Asian text in the current paragraph.
intgetAlignment()
voidsetAlignment(int value)
           Gets or sets text alignment for the paragraph. The value of the property is ParagraphAlignment integer constant.
booleangetBidi()
voidsetBidi(boolean value)
           Gets or sets whether this is a right-to-left paragraph.
BorderCollectiongetBorders()
           Gets collection of borders of the paragraph.
intgetDropCapPosition()
voidsetDropCapPosition(int value)
           Gets or sets the position for a drop cap text. The value of the property is DropCapPosition integer constant.
doublegetFirstLineIndent()
voidsetFirstLineIndent(double value)
           Gets or sets the value (in points) for a first line or hanging indent. Use a positive value to set a first-line indent, and use a negative value to set a hanging indent.
booleanisHeading()
           True when the paragraph style is one of the built-in Heading styles.
booleanisListItem()
           True when the paragraph is an item in a bulleted or numbered list.
booleangetKeepTogether()
voidsetKeepTogether(boolean value)
           True if all lines in the paragraph are to remain on the same page.
booleangetKeepWithNext()
voidsetKeepWithNext(boolean value)
           True if the paragraph is to remains on the same page as the paragraph that follows it.
doublegetLeftIndent()
voidsetLeftIndent(double value)
           Gets or sets the value (in points) that represents the left indent for paragraph.
doublegetLineSpacing()
voidsetLineSpacing(double value)
           Gets or sets the line spacing (in points) for the paragraph.
intgetLineSpacingRule()
voidsetLineSpacingRule(int value)
           Gets or sets the line spacing for the paragraph. The value of the property is LineSpacingRule integer constant.
intgetLinesToDrop()
voidsetLinesToDrop(int value)
           Gets or sets the number of lines of the paragraph text used to calculate the drop cap height.
booleangetNoSpaceBetweenParagraphsOfSameStyle()
voidsetNoSpaceBetweenParagraphsOfSameStyle(boolean value)
           When true, SpaceBefore and SpaceAfter will be ignored between the paragraphs of the same style.
intgetOutlineLevel()
voidsetOutlineLevel(int value)
           Specifies the outline level of the paragraph in the document. The value of the property is OutlineLevel integer constant.
booleangetPageBreakBefore()
voidsetPageBreakBefore(boolean value)
           True if a page break is forced before the paragraph.
doublegetRightIndent()
voidsetRightIndent(double value)
           Gets or sets the value (in points) that represents the right indent for paragraph.
ShadinggetShading()
           Returns a Shading object that refers to the shading formatting for the paragraph.
doublegetSpaceAfter()
voidsetSpaceAfter(double value)
           Gets or sets the amount of spacing (in points) after the paragraph.
booleangetSpaceAfterAuto()
voidsetSpaceAfterAuto(boolean value)
           True if the amount of spacing after the paragraph is set automatically.
doublegetSpaceBefore()
voidsetSpaceBefore(double value)
           Gets or sets the amount of spacing (in points) before the paragraph.
booleangetSpaceBeforeAuto()
voidsetSpaceBeforeAuto(boolean value)
           True if the amount of spacing before the paragraph is set automatically.
StylegetStyle()
voidsetStyle(Style value)
           Gets or sets the paragraph style applied to this formatting.
intgetStyleIdentifier()
voidsetStyleIdentifier(int value)
           Gets or sets the locale independent style identifier of the paragraph style applied to this formatting. The value of the property is StyleIdentifier integer constant.
java.lang.StringgetStyleName()
voidsetStyleName(java.lang.String value)
           Gets or sets the name of the paragraph style applied to this formatting.
booleangetSuppressAutoHyphens()
voidsetSuppressAutoHyphens(boolean value)
           Specifies whether the current paragraph should be exempted from any hyphenation which is applied in the document settings.
booleangetSuppressLineNumbers()
voidsetSuppressLineNumbers(boolean value)
           Specifies whether the current paragraph's lines should be exempted from line numbering which is applied in the parent section.
TabStopCollectiongetTabStops()
           Gets the collection of custom tab stops defined for this object.
booleangetWidowControl()
voidsetWidowControl(boolean value)
           True if the first and last lines in the paragraph are to remain on the same page as the rest of the paragraph.
 
Method Summary
voidclearFormatting()
           Resets to default paragraph formatting.
java.lang.ObjectfetchInheritedBorderAttr(int key)
          Reserved for internal use.
java.lang.ObjectfetchInheritedShadingAttr(int key)
          Reserved for internal use.
java.lang.ObjectgetDirectBorderAttr(int key)
          Reserved for internal use.
java.util.TreeMapgetPossibleBorderKeys()
          Reserved for internal use.
voidsetBorderAttr(int key, java.lang.Object value)
          Reserved for internal use.
 

Property Getters/Setters Detail

getAddSpaceBetweenFarEastAndAlpha/setAddSpaceBetweenFarEastAndAlpha

public boolean getAddSpaceBetweenFarEastAndAlpha() / public void setAddSpaceBetweenFarEastAndAlpha(boolean value)
Gets or sets a flag indicating whether inter-character spacing is automatically adjusted between regions of Latin text and regions of East Asian text in the current paragraph.

getAddSpaceBetweenFarEastAndDigit/setAddSpaceBetweenFarEastAndDigit

public boolean getAddSpaceBetweenFarEastAndDigit() / public void setAddSpaceBetweenFarEastAndDigit(boolean value)
Gets or sets a flag indicating whether inter-character spacing is automatically adjusted between regions of numbers and regions of East Asian text in the current paragraph.

getAlignment/setAlignment

public int getAlignment() / public void setAlignment(int value)
Gets or sets text alignment for the paragraph. The value of the property is ParagraphAlignment integer constant.

getBidi/setBidi

public boolean getBidi() / public void setBidi(boolean value)
Gets or sets whether this is a right-to-left paragraph.

When true, the runs and other inline objects in this paragraph are laid out right to left.


getBorders

public BorderCollection getBorders()
Gets collection of borders of the paragraph.

getDropCapPosition/setDropCapPosition

public int getDropCapPosition() / public void setDropCapPosition(int value)
Gets or sets the position for a drop cap text. The value of the property is DropCapPosition integer constant.

getFirstLineIndent/setFirstLineIndent

public double getFirstLineIndent() / public void setFirstLineIndent(double value)
Gets or sets the value (in points) for a first line or hanging indent. Use a positive value to set a first-line indent, and use a negative value to set a hanging indent.

isHeading

public boolean isHeading()
True when the paragraph style is one of the built-in Heading styles.

isListItem

public boolean isListItem()
True when the paragraph is an item in a bulleted or numbered list.

getKeepTogether/setKeepTogether

public boolean getKeepTogether() / public void setKeepTogether(boolean value)
True if all lines in the paragraph are to remain on the same page.

getKeepWithNext/setKeepWithNext

public boolean getKeepWithNext() / public void setKeepWithNext(boolean value)
True if the paragraph is to remains on the same page as the paragraph that follows it.

getLeftIndent/setLeftIndent

public double getLeftIndent() / public void setLeftIndent(double value)
Gets or sets the value (in points) that represents the left indent for paragraph.

getLineSpacing/setLineSpacing

public double getLineSpacing() / public void setLineSpacing(double value)
Gets or sets the line spacing (in points) for the paragraph.

When LineSpacingRule property is set to AtLeast, the line spacing can be greater than or equal to, but never less than the specified LineSpacing value.

When LineSpacingRule property is set to Exactly, the line spacing never changes from the specified LineSpacing value, even if a larger font is used within the paragraph.


getLineSpacingRule/setLineSpacingRule

public int getLineSpacingRule() / public void setLineSpacingRule(int value)
Gets or sets the line spacing for the paragraph. The value of the property is LineSpacingRule integer constant.

getLinesToDrop/setLinesToDrop

public int getLinesToDrop() / public void setLinesToDrop(int value)
Gets or sets the number of lines of the paragraph text used to calculate the drop cap height.

getNoSpaceBetweenParagraphsOfSameStyle/setNoSpaceBetweenParagraphsOfSameStyle

public boolean getNoSpaceBetweenParagraphsOfSameStyle() / public void setNoSpaceBetweenParagraphsOfSameStyle(boolean value)
When true, SpaceBefore and SpaceAfter will be ignored between the paragraphs of the same style.

This setting only takes affect when applied to a paragraph style. If applied to a paragraph directly, it has no effect.


getOutlineLevel/setOutlineLevel

public int getOutlineLevel() / public void setOutlineLevel(int value)
Specifies the outline level of the paragraph in the document. The value of the property is OutlineLevel integer constant.

getPageBreakBefore/setPageBreakBefore

public boolean getPageBreakBefore() / public void setPageBreakBefore(boolean value)
True if a page break is forced before the paragraph.

getRightIndent/setRightIndent

public double getRightIndent() / public void setRightIndent(double value)
Gets or sets the value (in points) that represents the right indent for paragraph.

getShading

public Shading getShading()
Returns a Shading object that refers to the shading formatting for the paragraph.

getSpaceAfter/setSpaceAfter

public double getSpaceAfter() / public void setSpaceAfter(double value)
Gets or sets the amount of spacing (in points) after the paragraph.

Has no effect when SpaceAfterAuto is true.


getSpaceAfterAuto/setSpaceAfterAuto

public boolean getSpaceAfterAuto() / public void setSpaceAfterAuto(boolean value)
True if the amount of spacing after the paragraph is set automatically.

When set to true, overrides the effect of SpaceAfter.

When you set paragraph Space Before and Space After to Auto, Microsoft Word adds 14 points spacing between paragraphs automatically according to the following rules:

  • Normally, spacing is added after all paragraphs.
  • In a bulleted or numbered list, spacing is added only after the last item in the list. Spacing is not added between the list items.
  • In a nested bulleted or numbered list spacing is not added.
  • Spacing is normally added after a table.
  • Spacing is not added after a table if it is the last block in a table cell.
  • Spacing is not added after the last paragraph in a table cell.

getSpaceBefore/setSpaceBefore

public double getSpaceBefore() / public void setSpaceBefore(double value)
Gets or sets the amount of spacing (in points) before the paragraph.

Has no effect when SpaceBeforeAuto is true.


getSpaceBeforeAuto/setSpaceBeforeAuto

public boolean getSpaceBeforeAuto() / public void setSpaceBeforeAuto(boolean value)
True if the amount of spacing before the paragraph is set automatically.

When set to true, overrides the effect of SpaceBefore.

When you set paragraph Space Before and Space After to Auto, Microsoft Word adds 14 points spacing between paragraphs automatically according to the following rules:

  • Normally, spacing is added after all paragraphs.
  • In a bulleted or numbered list, spacing is added only after the last item in the list. Spacing is not added between the list items.
  • In a nested bulleted or numbered list spacing is not added.
  • Spacing is normally added after a table.
  • Spacing is not added after a table if it is the last block in a table cell.
  • Spacing is not added after the last paragraph in a table cell.

getStyle/setStyle

public Style getStyle() / public void setStyle(Style value)
Gets or sets the paragraph style applied to this formatting.

getStyleIdentifier/setStyleIdentifier

public int getStyleIdentifier() / public void setStyleIdentifier(int value)
Gets or sets the locale independent style identifier of the paragraph style applied to this formatting. The value of the property is StyleIdentifier integer constant.

getStyleName/setStyleName

public java.lang.String getStyleName() / public void setStyleName(java.lang.String value)
Gets or sets the name of the paragraph style applied to this formatting.

getSuppressAutoHyphens/setSuppressAutoHyphens

public boolean getSuppressAutoHyphens() / public void setSuppressAutoHyphens(boolean value)
Specifies whether the current paragraph should be exempted from any hyphenation which is applied in the document settings.

getSuppressLineNumbers/setSuppressLineNumbers

public boolean getSuppressLineNumbers() / public void setSuppressLineNumbers(boolean value)
Specifies whether the current paragraph's lines should be exempted from line numbering which is applied in the parent section.

getTabStops

public TabStopCollection getTabStops()
Gets the collection of custom tab stops defined for this object.

getWidowControl/setWidowControl

public boolean getWidowControl() / public void setWidowControl(boolean value)
True if the first and last lines in the paragraph are to remain on the same page as the rest of the paragraph.

Method Detail

clearFormatting

public void clearFormatting()
Resets to default paragraph formatting. Default paragraph formatting is Normal style, left aligned, no indentation, no spacing, no borders and no shading.

fetchInheritedBorderAttr

public java.lang.Object fetchInheritedBorderAttr(int key)
Reserved for internal use.

fetchInheritedShadingAttr

public java.lang.Object fetchInheritedShadingAttr(int key)
Reserved for internal use.

getDirectBorderAttr

public java.lang.Object getDirectBorderAttr(int key)
Reserved for internal use.

getPossibleBorderKeys

public java.util.TreeMap getPossibleBorderKeys()
Reserved for internal use.

setBorderAttr

public void setBorderAttr(int key, java.lang.Object value)
Reserved for internal use.

See Also:
          Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
          Aspose.Words Support Forum - our preferred method of support.