Free Support Forum -

InsertHTML w/ images?

I'm trying to enable people to enter text into an html editing window and have the information, including images, saved to word. DOes aspose.words allow this? If not, are there any plans for it to in the near future?



This message was posted using Aspose.Live 2 Forum


Thank you for your interest in Aspose.Words. Yes, Aspose.Words allow convert HTML to word document. You can use the following code.

Document doc = new Document("in.html");

doc.Save("out.doc", SaveFormat.Doc);

Also you can insert html into the document (including pictures).

//Create document

Document doc = new Document();

DocumentBuilder builder = new DocumentBuilder(doc);

//Create HTML string

string someHtml = "";

//Insert HTML


//Save document


I hope this could help you.

Best regards.

That worked great. The one issue I'm encountering is that it will take external URLs but when I'm testing locally the page is at http://localhost/... and if I enter that, it can't find the image. Any ideas about this?




Thanks for your inquiry. I tried using localhost and all works fine on my side. Here is my html string

string html = "";

Please make sure that image exists and you have rights to read image.

Also try to open image in browser.

Best regards

Well, it seems to be working now. Go figure. Thanks!