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

Free Support Forum - aspose.com

Html-into-word_along_with_image

Hi Sir,

How to insert html (stream) with image into word. Can you please kindly help.
I am using builder.InsertHtml , but i need to insert image along with html into word , please help me.

Thank you,
Rao

Hi Sir,

How to insert html (stream) with image into word. Can you please kindly help.
I am using builder.InsertHtml to insert text , but i need to insert image please.

Thank you,
Rao

@annadatha.rao

Thanks for your inquiry. In your case, we suggest you please import the HTML stream into Aspose.Words.Document and insert it into Word document. Following code example inserts the HTML (stream) at the end of Word document. Hope this helps you.

Aspose.Words.LoadOptions loadOptions = new Aspose.Words.LoadOptions();
loadOptions.LoadFormat = LoadFormat.Html;

//stream contains the HTML
Document html = new Document(stream, loadOptions);

//Load the document to which you want to insert the html
Document doc = new Document(MyDir + "input.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.MoveToDocumentEnd();
builder.InsertDocument(html, ImportFormatMode.KeepSourceFormatting);

doc.Save(MyDir + "19.2.docx");

Hi Tahir,

Can you please give me sample html that you loaded please , i also need an image to display which is part of html please.

Thank you,
Rao.

Hi Tahir,

I mean i am getting {“Illegal characters in path.”} in html string.

Thank you,
Rao.

Hi Tahir,

I have got it , just ignore my request. Thank you for your help, god bless you.

rao.

@annadatha.rao

Thanks for your feedback. The images in your HTML stream should be in Base64 format. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.