Hi,
Aspose.Words (tested v14.5.0 , v14.6.0) does not correctly read the indentation of the list from the given file.
According to Word (v2010, see word.png), every paragraph has a left indentation of 0 cm.
But Aspose Words returns 0.0, 17.85, 35.7, 0.0, 17.85 and 35.7 pt.
for (Object p : new Document("test.rtf").getChildNodes(NodeType.PARAGRAPH, true))
System.out.println(((Paragraph) p).getListFormat().getListLevel().getNumberPosition());
Thanks
Romain
Hi Romain,
Thanks for your inquiry. Paragraph’s left indentation is represented by ParagraphFormat.LeftIndent property; and you can use the following code to get the actual values:
for (Paragraph para : (Iterable) doc.getChildNodes(NodeType.PARAGRAPH, true)){
System.out.println(para.getParagraphFormat().getLeftIndent());
}
Moreover, these paragraphs are formatted with “_ListNumber1”, “_ListNumber2” and “_ListNumber3” styles and these styles have indents too which are picked by Aspose.Words.
Best regards,
Hi,
Your code returns 17.85 pt left indentation for each paragraph. This does not match Ms Word either (0cm).
Thanks
Romain
Hi Romain,
Thanks for your inquiry. I tested the scenario and have managed to reproduce the same problem on my side. For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-10486. Our development team will further look into the details of this problem and we will keep you updated on the status of correction. We apologize for your inconvenience.
Best regards,
Hi Romain,
Regarding WORDSNET-10486, our development team has completed the work on your issue and has come to a conclusion that this issue and the undesired behaviour you’re observing is actually not a bug. So, we will close this issue as ‘Not a Bug’.
ParagraphFormat.LeftIndent is not that Word displays in UI but rather value that Word returns through VBA. You can verify it by executing following macro for each paragraph in the document.
MsgBox (Selection.ParagraphFormat.LeftIndent)
It will show the same result as Aspose.Words does.
UI value is effective left indentation which is calculated from few values and shown to user. There is no analogue in Aspose.Words yet.
If we can help you with anything else, please feel free to ask.
Best regards,