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

Free Support Forum - aspose.com

Html to word with image


I am using aspose.words in c# and am having an issue with an image not being displayed in the generated document. The image path is to a struts action with returns a image stream. I am also generating the document to pdf using easypdf and the image is displayed in that document, so its not an access issue. the html below contains the image path
Is this supported by aspose.words?



 <DIV class="x-panel-body x-panel-body-noheader x-panel-body-noborder" id=ext-gen1816 style="OVERFLOW: auto; WIDTH: 1034px;
HEIGHT: auto">dddsclient selection content</DIV>
<DIV class="x-panel-body x-panel-body-noheader x-panel-body-noborder" style="OVERFLOW: auto; WIDTH: 1034px; HEIGHT: auto"></br></DIV>
<DIV class="x-panel-body x-panel-body-noheader x-panel-body-noborder" style="OVERFLOW: auto; WIDTH: 1034px; HEIGHT: auto"></br><IMG
class=img-contact style="MARGIN: 0px 10px 10px 0px; WIDTH: 75px; CURSOR: pointer; HEIGHT: 75px" onclick='openImageManagementWindow("44","yrtyrt")'
alt=yrtyrt src="http://edubw127494.emea.win.ml.com:8080/studioII/imageManagement.do?method=accessImage&amp;attachmentId=44"


Thank you for additional information. I cannot reproduce the problem on my side using the latest version of Aspose.Words (9.3.0). You can download this version from here:

I use the following simple code for testing:

// Open Document
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.InsertHtml(@"<div><img src='http://localhost:2287/Default.aspx' /></div>");
// Save output document

The code from Default.aspx.cs:

protected void Page_Load(object sender, EventArgs e)
    //Specify the document type.
    Response.ContentType = "image/JPEG";
    Response.AddHeader("content-disposition", "inline; filename=out.jpg");
    //Get data bytes from the stream and send it to the response.
    byte[] bytes = File.ReadAllBytes(@"C:\Temp\img.JPG");

Best regards,