We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

List labels display not the same in MS Word and Open Office Writer

Hi Sirs,
We use DocumentBuilder to create List labels, but display not the same in MS Word and Open Office Writer.
Codes are …
static void Main(string[] args)
{

var doc = new Document();
doc.Styles.DefaultParagraphFormat.Style.Font.NameFarEast = "標楷體";
doc.Styles.DefaultParagraphFormat.Style.Font.NameAscii = "Times New Roman";
doc.Styles.DefaultParagraphFormat.Style.Font.Size = 16D;
var builder = new DocumentBuilder(doc);

doc.Lists.Add(ListTemplate.NumberDefault);
builder.ListFormat.List = ListSetting(doc, 0);

builder.Font.Size = 16D;
builder.Font.Color = Color.Black;
builder.ParagraphFormat.LineSpacingRule = LineSpacingRule.Multiple;
builder.ParagraphFormat.LineSpacing = 13.8;
builder.ParagraphFormat.Alignment = ParagraphAlignment.Justify;
builder.ListFormat.ListLevelNumber = 0;
builder.Writeln("測試測試測試測試測試測試測試測試測試測試測試測試測試測試測試測試測試測試測試測試測試測試測試測試測試測試測試測試測試測試");
builder.ListFormat.ListLevelNumber = 1;
builder.Writeln("TestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTest");
builder.ParagraphFormat.ClearFormatting();
builder.ListFormat.RemoveNumbers();
builder.Writeln();

doc.Save("TEST.doc", SaveFormat.Doc);
doc.Save("TEST.odt", SaveFormat.Odt);

}

private static List ListSetting(Document doc, int index)
{
var list = doc.Lists[index];
for (var i = 0; i < 9; i++)
list.ListLevels[i].TrailingCharacter = ListTrailingCharacter.Nothing;

list.ListLevels[0].NumberFormat = "\x0000、";
list.ListLevels[0].NumberPosition = 16;
list.ListLevels[0].TextPosition = 16 + 16 + 16;
list.ListLevels[0].NumberStyle = NumberStyle.TradChinNum3;

list.ListLevels[1].NumberPosition = 38;
list.ListLevels[1].TextPosition = 38 + 16 + 12;
list.ListLevels[1].NumberFormat = "(\x0001)";
list.ListLevels[1].NumberStyle = NumberStyle.TradChinNum3;

return list;

}

aspose.words.dll 's version is 17.6.0.0

opening TEST.odt with MS Word is correct.
opening Test.odt with Open Office Writer is incorrect.
Thank for your help.

@rainmaker_ho

Thanks for your inquiry. We have tested the scenario and noticed the list label appearance issue in Open Office. We have logged a ticket WORDSNET-15566 in our issue tracking system for further investigation and rectification. We will notify you as soon as it is resolved.

We are sorry for the inconvenience.

Best Regards,

@tilal.ahmad, Thanks for your help.

@rainmaker_ho

Thanks for your patience. We have investigated the issue and seems it is not a bug. Aspose.Words mimics same behavior as MS Word. If we save DOC\DOCX to ODT using MS Word, we will have the same behavior like Aspose.Words generated ODT document. MS Word shows 一、 and OpenOffice shows 1、 .

It seems that OpenOffice and MS Word work differently with the same document. We will appreciate it if you please confirm which behavior you expect?

@tilal.ahmad
Sorry for late.
I think the ODT presentation should be consistent with word.
Thanks for your help.

@rainmaker_ho

Thanks for your feedback. Aspose.Words for .NET already mimics MS Word behavior.

@tilal.ahmad
I mean shows 一、 and OpenOffice show 一、 .
Thanks.

@rainmaker_ho

I am afraid I am not clear about your reply. You mean MS Word generated file shows “一、” in OpenOffice at your end? Please share some more details along with sample screenshots. Please confirm your OpenOffice version as well.

Hi @tilal.ahmad,
I use Document class to save doc and odt.
MS Word shows 一、 and OpenOffice shows 1、
I need test.doc file shows 一、 in MS Word, and test.odt file shows 一、in Open Office Writer too.
Thank for your help.

@rainmaker_ho

Thanks for your feedback. We have logged a new ticket WORDSNET-15902 in our issue tracking system for your requirements. We will keep you updated about the issue resolution progress within this forum thread.

@rainmaker_ho

In reference to above logged issue, we will appreciate it if you please provide your expected document that shows same results both in MS Word and OpenOffice. It will help us to investigate and fulfill your requirement. Since we are unable to create a document which looks as expected both in OpenOffice and MS Word.

@tilal.ahmad
expectedFiles.zip (12.6 KB)
please ref the attatch file(expectedFiles.zip), thanks.

@rainmaker_ho

Thanks for sharing the expected documents. We have shared these documents with our Product team and will keep you updated about the issue resolution progress within this forum thread.

Thanks for your help.

@rainmaker_ho

Thanks for your patience. We have investigated your shared documents. First document TEST.doc document behaves same as we described above. However, second document TEST.odt shows the same result in both MS Word and OpenOffice. We have noticed that NumberStyle that is used in this document is KanjiDigit. So, if you want the same result in both MS Word and OpenOffice, then you must use KanjiDigit instead of TradChinNum3 as NumberStyle.

list.ListLevels[0].NumberStyle = NumberStyle.KanjiDigit;

Please note DOCX and ODT documents show same result in OpenOffice, LibreOffice and MS Words. But, OpenOffice, LibreOffice and MS Words show different results for DOC format with KanjiDigit NumberStyle. We think this happens because DOC is binary format and it is not native format for OpenOffice and LibreOffice.

1 Like

Hi @tilal.ahmad,
It’s worked. Thanks for your help.

@rainmaker_ho

Thanks for your feedback. It is good to know your issue has been fixed with above suggestion.

Please keep using Aspose.Words and feel free to contact us for any further assistance.