Free Support Forum - aspose.com

Problem with [MergeImageFieldEventHandler] after upgrading to Aspose.Words from Aspose.Word

Hi,

I've recently upgraded from Aspose.Word to Aspose.Words and there seems to be a problem in the MergeImageFieldEventHandler. I have the following code which worked fine in Aspose.Word:

private void HandleMergeCharts(object sender, MergeImageFieldEventArgs e)
{
if (Convert.IsDBNull(e.FieldValue)==false)
{
MemoryStream imageStream = new MemoryStream((byte[])e.FieldValue);
e.ImageStream = imageStream;
}
}

But in Aspose this results in an error because the e.FieldValue is an undefined value. It looks like the problem is in the fieldName. In the Word document there is a field called OP_chart and in the eventhandler it says the fieldname is OP so it misses the _chart part. Therefor it probably can't find the field in the dataset and the e.FieldValue is undefined.

Can anyone have a look at this, it's a real problem because I need the upgrade for another part so I can't switch back to the old version.

Best regards Patrick

That is a known problem with Aspose.Words 3.5.*. It will be fixed in the next release.

When will the next release become available? It's a problem for us because we can't generate a single document anymore, don't you have a hotfix for it?

Best regards

Patrick Keukens

We have fixed the issue of mergefield names like "TableStart:XX_YY" or "Image:XX_YY" being treated like XX instead of XX_YY. Please send us your document and a code snippet just to be sure that it also fixes the error in your case.

The fix will be published by the end of next week.