The attached doc has 2 lists in it (1 and 1.1) WrongIndent.zip (12.5 KB)
If you open it it at Word, you will see that the numbering is all aligned at 0.
However if you open it in Aspose and print out LeftIndent, FirstLineIndent, and NumberPosition, we get some interesting results for the 1 list.
Document doc = new Document("WrongIndent.docx");
var paras = doc.GetChildNodes(NodeType.Paragraph, true);
foreach (var para in paras)
{
Paragraph p = (Paragraph)para;
Console.WriteLine(p.GetText());
Console.WriteLine("Left Indent: {0}", p.ParagraphFormat.LeftIndent);
Console.WriteLine("First Line Indent: {0}", p.ParagraphFormat.FirstLineIndent);
if (p.IsListItem)
{
Console.WriteLine("Number Position: {0}", p.ListFormat.ListLevel.NumberPosition);
}
}
Gives me the results:
Definitions and interpretation
Left Indent: 35.4
First Line Indent: -34
Number Position: 22.7
Definitions
Left Indent: 35.45
First Line Indent: -34
Number Position: 0
Interpretation
Left Indent: 34
First Line Indent: -34
Number Position: 0
Priority of Contract documents
Left Indent: 35.4
First Line Indent: -34
Number Position: 22.7
Given the documentation says:
“The ListLevel.NumberPosition property gets or sets the position(in points) of the number or bullet for the list level. NumberPosition corresponds to LeftIndent plus FirstLineIndent of the paragraph.”
For the L1 numbered items (e.g. 1. Definitions and interpretation
) the numbers don’t add up: (Left Indent + First Line Indent) != Number Position