IntertHtml with an image

I am having trouble inserting images into documents using builder.InsertHtml().

This works fine on my localhost. However, it fails when not using localhost.

Example:

<IMG alt="" src="c:\location on my local pc">

or

<IMG alt="" src="http://mysite.com/images/some file">

The error message is:

Cannot find resource ‘Aspose.Words.NoImage.png’.

What does this mean?

Thanks,

John.

Hi John,

That works fine to me. Please provide an exact code snippet and tell what version of Aspose.Words you are using.

builder.InsertHtml("<img height=35 src=\"https://myserver/images/image.gif\" width=106 border=0>"); 

Users need to ability to update previous documents so I have them upload files, hence the url for a source.

I need to remote users to be able to see the images. When using localhost in my development environment it works fine. When I publish my code it fails for the error message given previously.

It even fails with Builder.InsertHtml("<p><img src=\"/images/image.gif\"></p>");

What are the requirements for where the image needs to be located. I am using FreeTextBox to create the html for documents, then creating word and pdf documents using Aspose.

I see the following line from your site that gives an example

// Convert image url to absolute path
Output = Output.ToLower().Replace("src=\"", "src=\"" + Server.MapPath(".") + "\\");

This is the file location, not a url. Can you use urls?

Yes URLs are surely allowed but I’ve discovered the bug causing that exception. Fixed in the next release. Thank you so much for reporting.