Re: Export Comments from Html to Docx format

Hi,

I am using the aspose.words.14.1.0 dll.

my html is as follows

<html>
<head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <meta name="generator" content="Aspose.Words for .NET 13.12.0.0" />
</head>
<body jQuery191008517083226373406="10">
    <ul style="list-style-type: disc; margin: 0pt; padding-left: 0pt;">
        <li style="line-height: 115%; text-indent: 0pt; margin: 0pt 0pt 0pt 28.06pt; padding-left: 7.94pt; font-family: serif; font-size: 11pt;"><span style="font-family: Calibri; font-size: 11pt; font-weight: bold;">Export (using HttpContext) &ndash; works for track changes and </span><span title="David:Second sub bullet in red mentions that comments are exported?:2/6/2014 7:29:00 PM" class="reComment reU0" style="font-family: Calibri; font-size: 11pt; font-weight: bold;">not for comments</span></li>
    </ul>
    <ins><span style="font-family: Calibri; font-size: 11pt;">The </span></ins><ins><span style="font-family: Calibri; font-size: 11pt;">bullet list numbering does not increase when trying to enter a new bullet point within RadEditor. This needs to be verified.</span></ins>
</body>
</html>

My code;

Document doc = new Document();
Aspose.Words.DocumentBuilder builder = new Aspose.Words.DocumentBuilder(doc);
builder.InsertHtml(Htmlcontent);

After this i check the comments collection the count is 0.
I am able to get the revisions by overriding the VisitRun method of documentvisitor class but no comments, as mentioned from the update the comments can be found in the footnote but it also returns empty.

thanks,
suraj

Hi Suraj,

Thanks for your inquiry.

But, when you convert this Html fragment to Word format using Microsoft Word 2013, you’ll observe the same behavior that there are no comments in generated Word docuement. In this case, Aspose.Words’ HTML engine mimics the behavior of Microsoft Word. However, please try importing the following HTML snippet into Aspose.Words’ DOM, in this case, comments will be imported correctly.

<body>
    <div>
        <p style="margin: 0pt">
            <span style="font-family: 'Times New Roman'; font-size: 12pt">Some text is added.</span><a name="_cmntref1"></a><a href="#_cmnt1">[AL1]</a>
        </p>
    </div>
    <hr style="width: 33%; height: 1px; text-align: left" />
    <div id="_cmnt1" style="-aw-comment-author: 'Amy Lee'; -aw-comment-datetime: '2014-05-06T00:00:00'; -aw-comment-initial: 'AL'">
        <p style="margin: 0pt">
            <a href="#_cmntref1">[AL1]</a><span style="font-family: 'Times New Roman'; font-size: 12pt">
                Comment
                text.
            </span>
        </p>
    </div>
</body>

I hope, this helps.

Best regards,

Hi ,

you are right i am able to import back the comments from html to docx, but now i am facing issue when there are multiple comments on the same text.

In this case the footnote positions are changed.

please see my post below

https://forum.aspose.com/t/58837

Thanks,
suraj

Hi Suraj,

Thank you for posting a separate thread for these problems. Please follow this thread for further proceedings.

Best regards,