Html to word- list

Hi,
When I convert html Ordered-list to Word, it seems to be working fine. But if I press Enter after List 1, then the List 10 text gets far from number.

The code I have used is

string dataDir = @"D:\";

// Initialize a Document.
Document doc = new Document();
string stringValue = @"
    <ol start="" 1"">
        <li> 1 </li>
        <li> 1 </li>
        <li> 2 </li>
        <li> 3 </li>
        <li> 4 </li>
        <li> 5 </li>
        <li> 6 </li>
        <li> 7 </li>
        <li> 8 </li>
        <li> 9 </li>
        <li> 10 </li>
        <li> 11 </li>
        <li> 12 </li>
        <li> 13 </li>
        <li> 14 </li>
        <li> 15 </li>
        <li> 16 </li>
        <li> 17 </li>
        <li> 18 </li>
    </ol>";

// Use a document builder to add content to the document.
DocumentBuilder builder = new DocumentBuilder(doc);
builder.InsertHtml(stringValue);
            
dataDir = dataDir + "CreateDocument_out_.docx";
// Save the document to disk.
doc.Save(dataDir);

Please check the attachment.

Could you please let me know what can be done to solve this problem.

Thanking you,
Lakpa Sherpa

Hi Lakpa,

Thanks for your inquiry. We have tested the scenario using latest version of Aspose.Words for .NET 16.4.0 and have not found the shared issue. Please use Aspose.Words for .NET 16.4.0. We have attached the output document with this post for your kind reference.

Hi Tahir,
Thank you for reply.
The problem doesn’t occur while creating doc file but if I open the DOC file created from Aspose.word in Microsoft Word and then press Enter in any number (1-10) the above scenario occurs.

In addition I get some other problem too

  1. If I select any number (1-9) and press (SHIFT + TAB) then the list isn’t aligned properly
  2. If I delete (10.) and add it again then it doesn’t get aligned properly with (11.)+ list.

Thanking you,
Lakpa

Hi Lakpa,

Thanks for sharing the detail.

Lakpa Sherpa:
The problem doesn’t occur while creating doc file but if I open the DOC file created from Aspose.word in Microsoft Word and then press Enter in any number (1-10) the above scenario occurs.

We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-13602. You will be notified via this forum thread once this issue is resolved. We apologize for your inconvenience.

*Lakpa Sherpa:

  1. If I select any number (1-9) and press (SHIFT + TAB) then the list isn’t aligned properly
  2. If I delete (10.) and add it again then it doesn’t get aligned properly with (11.)+ list.*

Could you please share the screenshots of these issues here for our reference?

For second issue, please share steps here to reproduce this issue at our end. We will investigate the issues and provide you more information.

Hi Tahir,
I have attached a screenshot of how to reproduce the error. This issue tested in Microsoft Word 2010 and 2016

Thanking you,
Lakpa

Hi Lakpa,

Thanks for sharing the detail. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-13613. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hi Tahir,
When <ol style='list-style-type: upper-roman;'> is used then the format isn’t correct.

string stringValue = @"
    <ol style='list-style-type: upper-roman;'>
        <li>a</li>
        <li>a</li>
        <li>a</li>
        <li>a</li>
        <li>a</li>
        <li>a</li>
        <li>a</li>
        <li>a</li>
        <li>a</li>
        <li>a</li>
        <li>a</li>
        <li>a</li>
    </ol>";

This happens on converted word file without edit.

Thanking you,

Hi Lakpa,

Thanks for your inquiry. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-13663. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-13663) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hi Lakpa,
Thanks for your patience. Please use latest version of Aspose.Words for .NET 16.6.0 and use DocumentBuilder.InsertHtml with UseBuilderFormatting=true as a workaround of issue (WORDSNET-13613). Hope this helps you.

Document doc = new Document();

string stringValue = @"
    <ol start=""1"">
        <li> 1 </li>
        <li> 1 </li>
        <li> 2 </li>
        <li> 3 </li>
        <li> 4 </li>
        <li> 5 </li>
        <li> 6 </li>
        <li> 7 </li>
        <li> 8 </li>
        <li> 9 </li>
        <li> 10 </li>
        <li> 11 </li>
        <li> 12 </li>
        <li> 13 </li>
        <li> 15 </li>
        <li> 16 </li>
        <li> 17 </li>
        <li> 18 </li>
    </ol>";

DocumentBuilder builder = new DocumentBuilder(doc);

builder.InsertHtml(stringValue, true);

doc.Save(MyDir + "Out.doc");
doc.Save(MyDir + "Out.docx");

The issues you have found earlier (filed as WORDSNET-13613) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hi Tahir,
I wondering if WORDSNET-13602 (Unresolved); is going to be fixed. I have asked this question almost a year ago (5-24-2016) when I first purchased the license and till now I haven’t had any update about it, whether or not its going to be resolved and my subscription is about to expire too.

Could you please let me know any update about it.

Thank you,
Lakpa Sherpa

Hi Lakpa,

Thanks for your inquiry. We regret to share with you that your issue has been postponed. I am afraid, there is no estimate available at the moment. However, we have asked for the ETA of this issue from our product team. As soon as any information is shared by them, we will be more than happy to share that with you.

We apologize for your inconvenience.

Hi,
Any progress on issue WORDSNET-13602

Thank you,
Lakpa Sherpa

@Lakpa_Sherpa,

Unfortunately, WORDSNET-13602 is not resolved yet and there is no further news about this issue. The implementation of the fix of this issue has been postponed till a later date. There are no estimates available at the moment. We will inform you via this thread as soon as this issue is resolved or any estimates are available. We apologize for your inconvenience.