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

Free Support Forum - aspose.com

Inserting HTML code with URL does not work properly

It seems that using URLs inside HTML-code doesn’t work properly.

want to insert html code that contains an url-link into a word document. After using builder.insertHTML inner address of url will be changed to + inner address of url-link.

is the corresponding code:

Document doc;
DocumentBuilder builder;

    doc = new Document();
    builder = new DocumentBuilder(doc);
    String htmlText = "<html><body><p><a href=\"www.cursor.de\">CURSOR web</a>;</p></body></html>";

    doc.save("c:\\Temp\\ASPOSE URL per HTML.doc");
catch (Exception e)

Result after inserting html:

Address of URL-Link = "c:\Temp\www.cursor.de"

would have expected "www.cursor.de"

a lot.

Matthias Schlosser


Thank you for reporting this problem to us. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is fixed.

Best regards,


I’m a developer from Aspose.Words project team. Thank you for your inquiry.

I have analysed issue, and became clear, that this behaviour is standard. By design Aspose.Words strive to support HTML 4.01 standart. Which describes that the “href” value of element is based on the URI format:
URI format is described in documents RFC (RFC 1630, RFC 2396, RFC 3986 is current):
By documents URI string format is correspond to “:” (protocol prefix is required).
As a workaround you can use “http://” prefix in links.

In conclusion, i note that a similar behavior is present in Internet Explorer, Mozilla FireFox, Opera, and Microsoft Word.

Regards, Andrey Kamimura.