EMF to SVG NullReferenceException

Hello I’m trying to convert a simple EMF to SVG but I’m getting this exception

Aspose.Imaging.CoreExceptions.ImageSaveException
HResult=0x80131500
Message=Image saving failed.
Source=Aspose.Imaging
StackTrace:
   at Aspose.Imaging.Image.Save(String filePath, ImageOptionsBase options, Rectangle boundsRectangle)
   at Aspose.Imaging.Image.Save(String filePath, ImageOptionsBase options)
   at ReportUtils.ReportExporter.Export() in 
   ...ReportExporter.cs:line 39
   at BrowserControl.PlanFinishingBrowserControl.ExportReport() in ....cs:line 56
   at BrowserControl.PlanFinishingBrowserControl.<.ctor>b__3_1(Object <p0>, LoadFinishedEventArgs <p1>) in ....cs:line 48
  at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
  at DotNetBrowser.Navigation.NavigationControllerRpcService.<WhenLoadFinished>b__115_0()
  at System.Threading.Tasks.Task.InnerInvoke()
  at System.Threading.Tasks.Task.Execute()

  This exception was originally thrown at this call stack:
  [External Code]

Inner Exception 1:
ImageSaveException: Image export failed.

Inner Exception 2:
NullReferenceException: Object reference not set to an instance of an object.

Here is the code snippet I’m using:

  using (var image = Image.Load("C:\\Users\\fernando.lopez\\Desktop\\Report3.emf"))
   {
       // Initilaize EmfRasterizationOptions class object
       var emfRasterizationOptions = new EmfRasterizationOptions();

       // emfRasterizationOptions.BackgroundColor = Color.White;
       emfRasterizationOptions.PageWidth = image.Width;
       emfRasterizationOptions.PageHeight = image.Height;

       // Save output SVG image
       image.Save("C:\\Users\\fernando.lopez\\Desktop\\SimpleReport.svg", new SvgOptions() {VectorRasterizationOptions = emfRasterizationOptions, TextAsShapes = true});
   }

And here the EMF file SimpleReport.zip (1.8 KB)

I would really appreciate your help, after this POC we will purchase the Imagin license

@flopezitw
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): IMAGINGNET-6283

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

1 Like

@flopezitw, we reproduced your issue and created ticket IMAGINGNET-6283 to fix it. You can view its status in this post.

1 Like

The issues you have found earlier (filed as IMAGINGNET-6283) have been fixed in this update. This message was posted using Bugs notification tool by samer.el-khatib