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

Free Support Forum - aspose.com

NullReferenceException when loading a Visio Drawing in VSDX format

Hi,

I’m currently evaluating Aspose.Diagram for .NET and it seems good so far. However, it throws a NullReferenceException when loading some Visio Drawing files in VSDX format. I have attached one such file to this message. I tested with the latest version of Aspose.Diagram at the time of this writing (version 17.9 for .NET Framework 3.5). Try loading the file as follows and you will get the exception:

Diagram = new Diagram("AsposeError.vsdx");

AsposeError.zip (3.5 KB)

@pavel_nevron,
We managed to replicate the null pointer error in our environment. It has been logged under the ticket ID DIAGRAMNET-51358 in our bug tracking system. We have linked your post to this ticket and will keep you informed regarding any available updates.

@pavel_nevron,
In reference to the ticket ID DIAGRAMNET-51358, please download and try the latest Hotfix version: Aspose.Diagram for .NET 17.9.1 and let us know how that goes into your environment.

1 Like

Thank you very much for the quick reaction. I confirm that the NullReferenceException bug with the attached Visio VSDX Drawing is now fixed.

Another small issue I have found is that when loading a VSDX file with shapes that contain text and exporting to the old Visio drawing format (Visio 2003-2010 XML Drawing - VDX) the font of the shapes in the resulting VDX file is a symbol font as shown on the following screenshot:

Aspose-VDX.png (9.1 KB)

The ZIP archive below contains the input VSDX file and the resulting VSDX filed saved with Aspose.Diagram for .NET 17.9.1:

SimpleDiagram.zip (11.2 KB)

@pavel_nevron,
We have opened your output VDX file in the Microsoft Visio application 2010 and 2013, but the text looks fine. We are unable to see the same problem as shown in the screenshot. Kindly let us know which Microsoft Visio application you are using to open it.

I open the VDX file with Visio 2016 and the result is shown at the screenshot in my previous post. You are right that it’s OK in Visio 2013.

Visio 2016 shows that the shape in the VDX file is using the font “AIGDT”, which seems to be a symbol font.When I change the font in Visio 2016 to Arial, then the text looks OK. Maybe Visio 2016 does not read properly the font name for the shape or it expects the font name to be written explicitly in the VDX file somehow.

@pavel_nevron,
We have logged an investigation under the ticket ID DIAGRAMNET-51361 in our issue tracking system. We have linked your post to this ticket and will keep you informed regarding any available updates. Besides this, we do not recommend to save the latest Visio drawing in an old format. Microsoft Visio 2013 and 2016 applications do not allow to save a drawing in the VSD or VDX format and have added support of an alternative format VSDX. Aspose.Diagram API has support of reading and writing VSDX drawings.

Hi @imran.rafique, thank you for your reply. Yes, I’m well aware of the new Office Open XML based Visio drawing file format (VSDX). It’s well documented, so I’ve been able to create a VSDX reader and writer from scratch, but the application we are developing also needs to open and save old Visio drawings and that is why I’m currently evaluating your library.

I found that Aspose.Diagram can load VSD and VDX files, but can only save to VDX and that is why it’s important for us to at least have a good VDX export in our application, so that users can open drawings even with old versions of Visio.

Once again thank you for the prompt replies and the good support.

@pavel_nevron,
Sure, we will let you know once the linked ticket ID DIAGRAMNET-51361 is fixed.

@pavel_nevron,
The linked ticket IDs DIAGRAMNET-51358 and DIAGRAMNET-51361 have been resolved. If there is no issue in the quality assurance phase, then these fixes will be included in the next version 17.10 of Aspose.Diagram for .NET API. We will notify you once it is published.

1 Like

@pavel_nevron,

The linked ticket IDs DIAGRAMNET-51358 and DIAGRAMNET-51361 have been resolved. Please download and try the new version 17.10 of Aspose.Diagram for .NET API.