We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Words for .net - HTML to Docx

I tried out converting an html document to docx using Aspose.Words for .net. It is working fine, but if the html contains images, it does not shows up inside the converted docx file.
Im triying to use this inside Sharepoint 2010, I will be creating the html by joining the list items, so the image url might be like “libraryname/imagename.png” or an http url.
Please advise.

Thanks for your request. The problem might occur because Aspose.Words cannot find the images by specified paths. Have you tried specifying full path to image to full url. I think, in this case, the images will be correctly imported into the document.
Best regards,

tried giving full url, that alo doesn’t seems to work

Thanks for your inquiry. Could you please attach the input HTML document (with images) you are getting problem with? I will check it on my side and provide you more information.
Best regards,

Please find the samle html code…

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    Looks how cool is <font size="x-large"><b>Open Xml</b></font>.
    Now with <font color="red"><u>HtmlToOpenXml</u></font>, it nevers been so easy to convert html.
        If you like it, add me a rating on <a href="http://notesforhtml2openxml.codeplex.com">codeplex</a>
    <a href="http://www.wikipedia.org">
        <img alt="Wikipedia, the Free Encyclopedia" src="_layouts/TestProject/Wikipedia-logo.png" />
    <table width="50%" align="center" border="1">
            <td rowspan="2">Anime Studio</td>
            <td>Studio Ghibli</td>
    <table width="100%" border="1">
        <tr style="font-weight: bold">
            <td colspan="2">Animes</td>
            <td>The incredibles</td>
            <td>Studio Ghibli</td>
            <td>Grave of the Fireflies</td>
            <td>Spirited Away</td>
    The <abbr title="World Health Organization">WHO</abbr> was founded in 1948.

Thank you for additional information. I cannot reproduce the problem on my side using the latest version of Aspose.Words (10.4.0). Here are my steps:

  1. I have created virtual directory on my machine.
  2. Then I have added images to this directory
  3. And then I have converted HTML to DOC.

Moreover I have tried using the following code, and it works fine too:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

I think, in your case you can try using MHTML, which is actually HTML with all resources embedded. Also, you can try storing your images as base64 in your HTML documents. Using Aspose.Words you can import and export HTML with such images:
Best regards,