Free Support Forum -

Error saving diagram page as file type EMF

I am getting the following error when trying to save a diagram page as file type EMF (Aspose.Diagram v3.5.0.0):

Value cannot be null.
Parameter name: encoder


Aspose.Diagram.Saving.ImageSaveOptions imageSaveOptions = new Aspose.Diagram.Saving.ImageSaveOptions(SaveFileFormat.EMF);

for (int p = 0; p < diagram.Pages.Count; p++)
if (diagram.Pages[p].Background != Aspose.Diagram.BOOL.True)
imageSaveOptions.PageIndex = p;

byte[] imageContent;

using (System.IO.MemoryStream imageStream = new System.IO.MemoryStream())
diagram.Save(imageStream, imageSaveOptions);

imageContent = imageStream.GetBuffer();

Hopefully I’m just missing something obvious?


Hi Jason,

Thank you for reporting this problem. I managed to replicate this error message using my own sample document. I have logged this problem under ticket id DIAGRAM-33438 in our issue tracking system. Furthermore, I will encourage you to share your sample diagrams in this forum thread. It will make sure that its fix is also fruitful to you as well. Your request has also been linked to this forum thread and you will be notified as soon as it is fixed. We’re sorry for your inconvenience.

The issues you have found earlier (filed as DIAGRAM-33438) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.