Free Support Forum - aspose.com

Exporting html to word with images embbeded

I would like to know if Aspose.Words for .NET can take any html content including images and then export to a Word document embbeding the images, not linking them

Hi Dariel,


Thanks for your inquiry. Yes, you can convert HTML to document with embedded images by using following code snippet.

<span lang=“EN-GB” style=“font-size:10.0pt;font-family:“Courier New”;color:#2B91AF;mso-font-kerning:
0pt;mso-no-proof:yes”>Document<span lang=“EN-GB” style=“font-size:10.0pt;
font-family:“Courier New”;mso-font-kerning:0pt;mso-no-proof:yes”> doc = new Document(MyDir

  • “in.html”);<o:p></o:p>

doc.Save(MyDir + "AsposeOut.doc");

Please let us know if you have any more queries.

Hi Dariel,


Thanks for your inquiry. Additionally, please note that Aspose.Words automatically downloads the image before inserting into the Word document if you specify a URL in src attribute of img tag in HTML.

Best Regards,

Yeah, thanks. I already have that code.

What I´m struggling is with the temporal license. I have the file, but I´m not sure where to place it.

I placed the file into the same folder where my code is, and also in the root of the project.

Then, run the application and sent me the error:

NotSupportedException was unhandled by user code.

The invoked member is not supported in a dynamic assembly.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

So what else should I do to make it work with this temporal license. Because if I don´t use the temporal license will generate the Word document without the content that I wanted to export and instead says something about

Evaluation Only. Created with Aspose.Words. Copyright
2003-2011 Aspose Pty Ltd.

This document was truncated here because it was created using
Aspose.Words in Evaluation Mode.

Evaluation Only. Created with Aspose.Words. Copyright
2003-2011 Aspose Pty Ltd.

This document was truncated here because it was created using
Aspose.Words in Evaluation Mode.

Dariel.

Hi Dariel,


Thanks for your inquiry. Please use the License.SetLicense method to set the license of Aspose.Words as shown below:

<span lang=“EN-GB” style=“font-size:10.0pt;font-family:“Courier New”;mso-font-kerning:0pt;
mso-no-proof:yes”>Aspose.Words.License
license = new Aspose.Words.License();<o:p></o:p>

license.SetLicense(@"D:\Aspose.Words.lic");


Please read following articles for your kind reference.

http://www.aspose.com/docs/display/wordsnet/Applying+a+License

http://www.aspose.com/docs/display/wordsnet/Including+the+License+File+as+an+Embedded+Resource
http://www.aspose.com/docs/display/wordsnet/When+to+Apply+a+License
http://www.aspose.com/docs/display/wordsnet/You+can+Change+the+License+File+Name
http://www.aspose.com/docs/display/wordsnet/Exception++Cannot+find+license+filename
http://www.aspose.com/docs/display/wordsnet/Using+Multiple+Products+from+Aspose

Please let us know if you have any more queries.