Docx Save - Missing Image

Hi,

When a docx file has an image, it does not show up. The text in a docx file displays fine. Also, doc files work fine with images. I am using Aspose.Words version 4.4.3.0
Please let me know what you think might be the issue. Thanks!
Here is the code I am using:

Aspose.Words.Document docs1 = new Aspose.Words.Document(document.FilePathAndName);
MemoryStream outStream1 = new MemoryStream();
docs1.Save(outStream1, SaveFormat.Docx);
Response.ContentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
Response.AddHeader("content-disposition", "attachment; filename=test.docx");
Response.BinaryWrite(outStream1.ToArray());
Response.Flush();
Response.End();

Hi,

Thanks for your inquiry.

You are using a very old version of Aspose.Words; could you please upgrade to latest version of Aspose.Words i.e. 13.2.0 and let us know how does it go on your side? You can download it from the following link:
https://releases.aspose.com/words/net

In case the problem still remains, could you please also attach your input Word document (.docx file) here for testing? I will investigate the issue on my side and provide you more information.

Best regards,

Hi,

I did an upgrade to Aspose.Words for .NET 130322090741.
After the upgrade my existing code throws error. It can’t find ReplaceEvaluator, ReplaceEvaluatorArgs. DocumentBuilder no longer accepts DocumentBase as an argument.
Please advise.

Thanks

Hi,

Thanks for your inquiry.

ReplaceEvaluator delegate was replaced with IReplacingCallback interface and the event handler method Replacing needs to be wrapped in a class that implements IReplacingCallback interface. Please see the following link for more information:
https://docs.aspose.com/words/net/

Secondly, you can use the following DocumentBuilder Constructors to initializes a new instance of this class:

public DocumentBuilder();
public DocumentBuilder(Document);

I hope, this helps.

Best regards,

Thank you for your response. I have one more question. I had license for Words and Pdf in the same file, Aspose.Custom.lic. I did an upgrade only for Words and now I have Aspose.Words.lic. With this, I have Aspose.Words in two license files. Is that okay?

Thanks

Hi,

Thanks for your inquiry.

Sure, in this case you can set a license separately for each Aspose product you are using. For example, if you are using Aspose.Words and Aspose.Pdf, code for setting the license will look like this:

Aspose.Words.License awLic = new Aspose.Words.License();
awLic.SetLicense("Aspose.Words.lic");

Aspose.Pdf.License pdfLicense = new Aspose.Pdf.License();
pdfLicense.SetLicense("Aspose.Custom.lic");

If we can help you with anything else, please feel free to ask.

Best regards,

Thank you for your help!