Major issue (bug) with numeric bullets when converting to html!

Hi,
We are using the Aspose.Words for some time and we now discover a major issue with the conversion of numeric bullets to html. This issue effects all of the data that we already converted using Aspose.Words.
Attached a word document with the following numeric bullets:

1. aaa
1.1. aaa
1.2. aaa

2. bbb
2.1. bbb
2.2. bbb
2.3. bbb
2.4. bbb

When converting it to html using the following code (test code):

File.WriteAllText(@"E:\WordTest\1.htm", new Aspose.Words.Document(@"E:\WordTest\1.doc").ToString(
new Aspose.Words.Saving.HtmlSaveOptions
{
    ExportImagesAsBase64 = true,
    ExportHeadersFootersMode = Aspose.Words.Saving.ExportHeadersFootersMode.None
}));

The result is:

1. aaa
1. aaa
2. aaa

2. bbb
1. bbb
2. bbb
3. bbb
4. bbb

As you can see number 1.1 is now 1 and 2.1 is also 1. This is very critical since our users using both word and the html version and point each other to a specific number (like 2.1).
Can you solve this ASAP so we can re-convert all of our documents?
Thanks,
Omri

Hi Omri,

Thanks for your inquiry.

While using the latest version of Aspose.Words i.e. 15.12.0, we managed to reproduce this issue on our end. We have logged this issue in our bug tracking system. The ID of this issue is WORDSNET-12982. Your thread has also been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

As a workaround, please use the following code:

Document doc = new Document(MyDir + @"1.doc");
HtmlSaveOptions opts = new HtmlSaveOptions(SaveFormat.Html);
opts.ExportImagesAsBase64 = true;
opts.ExportHeadersFootersMode = Aspose.Words.Saving.ExportHeadersFootersMode.None;
doc.Save(MyDir + @"15.12.0.html", opts);

Hope, this helps.

Best regards,

Hi,
Thank you for your replay.
Unfortunately this workaround is not good for us since we not only saves the entire document but also StructuredDocumentTag nodes. And a Aspose.Words.Node don’t have a Save method, only ToString method.
I can confirm that the Save workaround works, but it is not a solution for us.
Please handle it as quickly as possible since this is a major issue for us.
Thanks!

Hi Omri,

Thanks for your inquiry. This issue is pending for analysis and is in the queue. We will inform you via this thread as soon as this issue is resolved. We apologize for any inconvenience.

Best regards,

Hi,
Any news regarding this issue?

Omri

Hi Omri,

Thanks for your inquiry. Unfortunately, your issue is not resolved yet. We have asked the ETA of this issue from our product team and will update you as soon as any estimates are available. We apologize for your inconvenience.

Best regards,

Hi,
Any news regarding this issue?
Do you have a bug number?

Omri

Hi Omri,

Thanks for your inquiry. The ID of this issue is WORDSNET-12982. We have verified the status of this issue from our issue tracking system and regret to share that this issue is still unresolved. Currently, it is in development phase. We will inform you via this thread as soon as it is resolved. Sorry for any inconvenience.

Best regards,

Hi Omri,

Thanks for being patient. While you’re waiting for a fix, we can offer you another workaround to fix this issue. You can import any desired node to a new empty document and then use Save() method to save the whole document. You should get expected result in this case. We will inform you via this thread as soon as this issue is resolved. We apologize for any inconvenience.

Best regards,

Hi,
Thank you for your replay.
Unfortunately this workaround is not good for us since we can’t save more then one document.
Please handle it as quickly as possible since this is a major issue for us.
Thanks!

Hi Omri,

We have passed your concern to our product team and will inform you as soon as this issue is resolved. We apologize for any inconvenience.

Best regards,

Hi,
Any news about this?

Omri

Hi Omri,

We have verified the status of this issue from our issue tracking system and regret to share that this issue is still unresolved. Currently, it is in development phase. We will inform you via this thread as soon as it is resolved. Sorry for any inconvenience.

Best regards,

Hi Omri,

It is to update you that we have just released a new version of Aspose.Words for .NET. We can see now your problem can be solved. Yes, Node.ToString(…) doesn’t write style section to an output string, but it is now possible to do this easily using ICssSavingCallback interface as follows:

const string homeFolder = @"input.doc";
var so = new HtmlSaveOptions();
var cssCallback = new CssSavingCallback();
so.CssSavingCallback = cssCallback;
so.CssStyleSheetType = CssStyleSheetType.External;
var doc = new Document(homeFolder + "1.doc");
var node = doc; //var node = GetNode(doc);
var html = node.ToString(so);
var css = "\r\n\r\n" + cssCallback.GetCss() + "\r\n\r\n";
const string htmlTag = "";
var index = html.IndexOf(htmlTag, StringComparison.InvariantCulture);
if (index != -1)
index += htmlTag.Length;
else
index = 0;
html = html.Insert(index, css);
File.WriteAllText(homeFolder + "newout.html", html);
internal class CssSavingCallback : ICssSavingCallback
{
    public void CssSaving(CssSavingArgs args)
    {
        mCssStream = new MemoryStream();
        args.CssStream = mCssStream;
        args.IsExportNeeded = false;
        args.KeepCssStreamOpen = true;
    }
    internal string GetCss()
    {
        mCssStream.Seek(0, SeekOrigin.Begin);
        var css = Encoding.UTF8.GetString(mCssStream.ToArray());
        return css;
    }
    private MemoryStream mCssStream;
}

Hope, this helps.

Best regards,

Hi,

First of all, thank you for the support in this case, this is a major issue for us.

Unfortunately, we can’t use CSS, since this html is embeds inside a larger HTML. So it needs to be “pure” html.
CSS can be “translated” to style attribute on the main div of the node. Can you support this kind of solution? and if not, what can we do?

Thanks

Hi Omri,

Thanks for your inquiry. We have passed your concern to our product team and will keep you informed of any further developments.

Best regards,

Hi,
It’s been over a month. Any news?

Hi Omri,

Thanks for your inquiry.

Unfortunately, your issue is not resolved yet and there are no estimates available. Because of complexity, the implementation of the fix of this issue has been postponed till a later date. We will inform you as soon as this issue is resolved. We apologize for your inconvenience.

Best regards,

Any news about this issue?

Hi Omri,

Thanks for your inquiry. Unfortunately, your issue is not resolved yet. We have asked the ETA of this issue from our product team and will update you as soon as any estimates are available. We apologize for your inconvenience.

Best regards,