Free Support Forum - aspose.com

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”);<o:p></o:p>

HtmlFixedSaveOptions option = new HtmlFixedSaveOptions();<o:p></o:p>

option.SaveFormat = SaveFormat.HtmlFixed;<o:p></o:p>

doc.Save(MyDir + “out.html”, option);<o:p></o:p>



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.