Displaying line numbers

Hi.

Seems like i am not able to make line numbers in docx files be displayed when using Aspose.Words.13.2.0 to convert DOCX into HTML:

Can anyone help me with that?

Hi Filonov,

Thanks for your inquiry. Please note that Aspose.Words tries to mimic the same behavior as MS Word do. If you convert your Docx to HTML by using MS Word, you will get the same output.

However, you may use HtmlFixedSaveOptions to get output in HtmlFixed save format as shown in following code snippet. By using HtmlFixed save format, you can get the line numbers. Please use the latest version of Aspose.Words for .NET 13.3.0.

Document doc = new Document(MyDir + "in.docx");
HtmlFixedSaveOptions option = new HtmlFixedSaveOptions();
option.SaveFormat = SaveFormat.HtmlFixed;
doc.Save(MyDir + "out.html", option);

Hope this helps you. Please let us know if you have any more queries.

Thanks Tahir.

I was able to display line numbers with HtmlFixed switch turned ON.

Thanks for your help.

Hi Filonov,

Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.