Error converting insanely simple VSDX to PDF

The following is a very very simplified version of the actual code in my application; I was able to isolate the problem to this code and the attached vsdx file:


using (MemoryStream msSource = new MemoryStream(System.IO.File.ReadAllBytes(“c:\test.vsdx”)))
{
Aspose.Diagram.Diagram vDoc = new Aspose.Diagram.Diagram(msSource);
using (MemoryStream msTarget1 = new MemoryStream())
{
vDoc.Save(msTarget1, Aspose.Diagram.SaveFileFormat.VSDX);
using (MemoryStream msTarget2 = new MemoryStream(msTarget1.ToArray()))
{
Aspose.Diagram.Diagram vDoc2 = new Diagram.Diagram(msTarget2);
vDoc2.Save(“c:\test.pdf”, Diagram.SaveFileFormat.PDF);
}
}
}

I’m getting the following exception on the last line (save as pdf):

System.ArgumentNullException was unhandled
HResult=-2147467261
Message=Key cannot be null.
Parameter name: key
Source=mscorlib
ParamName=key
StackTrace:
at System.Collections.Hashtable.get_Item(Object key)
at (Object , Object )
at ‹.Ž.‹(String familyName, FontStyle style)
at ‹.Ž.GetFont(String familyName, FontStyle style)
at ‹.Œ.GetFont(String familyName, FontStyle style)
at ‹.‹.‹(String familyName, FontStyle style, String altFamilyName)
at ‹.‹.‘‹(String familyName, Single sizePoints, FontStyle style, String altFamilyName)
at Ÿ.„.†‚(Char charNode, FontCollection fonts, Single fontSize, String defaultFont)
at Ÿ..‚(Int32 charIX)
at Ÿ.…ctor( drwShape, Single resolution, Double scaleRate, String defaultFontName)
at Ÿ.€.‚( drwShape, ˜ canvas)
at Ÿ.€.a‚(˜ canvas,  drwShape)
at Ÿ.€.‚(Page page, „˜ apsPage)
at Ÿ.€.a(Page page)
at ..†–(€ apsRenderer, Page page)
at ..Save(Stream stream, PdfSaveOptions pdfOptions, Diagram diagram)
at Aspose.Diagram.Diagram.Save(Stream stream, SaveOptions options)
at Aspose.Diagram.Diagram.Save(String filename, SaveFileFormat format)


Of course, my code does a lot of other things in between, but as I stated, I was able to isolate the problem to this code and the file attached.

Please help me, my client has a lot of Visio files and this problem is showing up frequently.

Javier Pelaez

Hi Javier,


Thank you for contacting support. We have evaluated your sample Visio drawing “test.vsdx” and code against the latest version 6.1.1.0 of the Aspose.Diagram API and figured out how to duplicate the said error message on our side. We’ve logged this problem under ticket id DIAGRAMNET-50723 in our bug tracking system. Your post has also been linked to this ticket. We’ll keep you informed regarding any available updates. We’re sorry for the inconvenience caused.

Hi Javier,


Thank you for being patient. We have a good news for you that the issue id DIAGRAMNET-50723 has now been resolved. If there is no issue in the QA phase, then this fix will be included in the next version of Aspose.Diagram for .NET 6.2.0. We’ll inform you via this forum thread as soon as the new release is published.

The issues you have found earlier (filed as DIAGRAMNET-50723) have been fixed in Aspose.Diagram for .NET 6.2.0.


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