Hello,
we have a paragraph p and try to set the leftIndent-Property on p.getParagraphFormat()
. Unfortunately it doesn’t seem to work as we don’t see the desired indent it the pdf/rtf. When we set it on p.getParagraphFormat().getStyle().getParagraphFormat()
it seems to work but affects other paragraphs we don’t want to indent. When we call p.getParagraphFormat().clearFormatting()
prior to setting the leftIndent-Property everysting works fine but we have the feeling that we eventually lose some formats when we do so.
Here are the values of the get* and is*-Methods from p.getParagraphFormat()
and p.getParagraphFormat().getStyle()
before and after the call to clearFormatting()
. It seems to change the basestyle but isn’t the p.getParagraphFormat()
supposed to overwrite the settings of p.getParagraphFormat().getStyle().getParagraphFormat()
anyways?
Before clearFormatting()
===============================
-------------------------------
ParagraphFormat
-------------------------------
isListItem: false
getStyle: <com.aspose.words.Style@118072d>
getBorders: <com.aspose.words.BorderCollection@7f3fd1>
getAlignment: 0
getStyleName: Normal\_58\_2
getBidi: false
getStyleIdentifier: 4094
getOutlineLevel: 9
getSpaceBeforeAuto: false
getTabStops: <com.aspose.words.TabStopCollection@36f12b>
getShading: <com.aspose.words.Shading@1135ae2>
isHeading: false
getDirectBorderAttr: Fehler
getLeftIndent: 0.0
getRightIndent: 0.0
getSpaceAfter: 0.0
getSpaceBefore: 0.0
getDropCapPosition: 0
getFirstLineIndent: 0.0
getKeepTogether: false
getKeepWithNext: false
getLineSpacing: 12.0
getLineSpacingRule: 2
getLinesToDrop: 0
getNoSpaceBetweenParagraphsOfSameStyle: false
getPageBreakBefore: false
getSpaceAfterAuto: false
getSuppressAutoHyphens: false
getSuppressLineNumbers: false
getWidowControl: true
getClass: class com.aspose.words.ParagraphFormat
-------------------------------
Style
-------------------------------
getName: Normal\_58\_2
getType: 1
getStyles: <com.aspose.words.StyleCollection@1822edd>
getDocument: <com.aspose.words.Document@1d2d3d8>
getList: null
getFont: <com.aspose.words.Font@52247c>
getParagraphFormat: <com.aspose.words.ParagraphFormat@d9752a>
getListFormat: <com.aspose.words.ListFormat@9b2e60>
getDirectRunAttr: Fehler
getDirectRunAttrByIndex: Fehler
getDirectRunAttrsCount: 5
getBaseStyleName:
getBuiltIn: false
getStyleIdentifier: 4094
getDirectParaAttr: Fehler
getDirectParaAttrByIndex: Fehler
getDirectParaAttrsCount: 7
getNextParagraphStyleName: Normal\_58\_2
isHeading: false
After clearFormatting()
===============================
-------------------------------
ParagraphFormat
-------------------------------
isListItem: false
getStyle: <com.aspose.words.Style@cc4f58>
getBorders: <com.aspose.words.BorderCollection@7f3fd1>
getAlignment: 0
getStyleName: Normal
getBidi: false
getStyleIdentifier: 0
getOutlineLevel: 9
getSpaceBeforeAuto: false
getTabStops: <com.aspose.words.TabStopCollection@16d4e1b>
getShading: <com.aspose.words.Shading@122dfc2>
isHeading: false
getDirectBorderAttr: Fehler
getLeftIndent: 0.0
getRightIndent: 0.0
getSpaceAfter: 0.0
getSpaceBefore: 0.0
getDropCapPosition: 0
getFirstLineIndent: 0.0
getKeepTogether: false
getKeepWithNext: false
getLineSpacing: 12.0
getLineSpacingRule: 2
getLinesToDrop: 0
getNoSpaceBetweenParagraphsOfSameStyle: false
getPageBreakBefore: false
getSpaceAfterAuto: false
getSuppressAutoHyphens: false
getSuppressLineNumbers: false
getWidowControl: true
getClass: class com.aspose.words.ParagraphFormat
-------------------------------
Style
-------------------------------
getClass: class com.aspose.words.Style
getName: Normal
getType: 1
getStyles: <com.aspose.words.StyleCollection@1822edd>
getDocument: <com.aspose.words.Document@1d2d3d8>
getList: null
getFont: <com.aspose.words.Font@1b67a>
getParagraphFormat: <com.aspose.words.ParagraphFormat@731d3c>
getListFormat: <com.aspose.words.ListFormat@184558d>
getDirectRunAttr: Fehler
getDirectRunAttrByIndex: Fehler
getDirectRunAttrsCount: 5
getBaseStyleName:
getBuiltIn: true
getStyleIdentifier: 0
getDirectParaAttr: Fehler
getDirectParaAttrByIndex: Fehler
getDirectParaAttrsCount: 7
getNextParagraphStyleName: Normal
isHeading: false
getClass: class com.aspose.words.Style
With kind regards
Klemens Schrage