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

Free Support Forum - aspose.com

Html to word with image

Hi,

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?

thanks,

Brian

 <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"
align=left></DIV>

Hello

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:
https://downloads.aspose.com/words/net

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
doc.Save("out.doc");

The code from Default.aspx.cs:

protected void Page_Load(object sender, EventArgs e)
{
    Response.Clear();
    
    //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");
    Response.BinaryWrite(bytes);
    Response.End();
}

Best regards,