We’re a long-time Aspose user of Word/Cell/Slide/PDF and I just started to test Diagram. The attached VSD example I simply wanted to load, and save out as PNG and/or HTML. When I did it it basically missed all the shapes.
Here is the code:
Aspose.Diagram.Diagram visioDoc = default(Aspose.Diagram.Diagram);
using (System.IO.MemoryStream blobStream = new System.IO.MemoryStream(fileData))
{
visioDoc = new Aspose.Diagram.Diagram(blobStream);
if (visioDoc != null)
{
results.pageCount = visioDoc.Pages.Count;
using (MemoryStream imageStream = new MemoryStream())
{
Aspose.Diagram.Saving.ImageSaveOptions saveOpts = new Aspose.Diagram.Saving.ImageSaveOptions(Aspose.Diagram.SaveFileFormat.PNG);
// Generate the first page for the preview
[//saveOpts.PageIndex](https://saveopts.pageindex/) = 0;
saveOpts.Resolution = 300.0f;
visioDoc.Save(imageStream, saveOpts);
results.previewImage = imageStream.ToArray();
visioDoc.Save(“e:\fred.png”, saveOpts);
visioDoc.Save(“e:\fred1.html”, Aspose.Diagram.SaveFileFormat.HTML);
}
}
}
The visioDoc.Pages.Count does not give 3 like I expected and the saved PNG/HTML are missing everything bar about 4 shapes and all pages 2 & 3. I’ve attached my input file and the PNG and HTML output.
This is because of evaluation limitation which allows you to read one page and few shapes. You can apply for a temporary license and test with a licensed version which will give you correct result.
Thanks! I noticed I was not loading the license correctly, so once I did that, things go a little better.
Now, there does seam to be a problem with PNG output - I’m just saving a single page (PageIndex = 0) and the resulting page has white-space below the diagram. I used the latest DLL’s to do this and the same code I gave, with the PageIndex line commented in will show the problem.
This does seam like the same problem as this post. Thanks, Andy.
Yes, you are right. I can notice the same issue at my end. Your mentioned issue was logged for Java and it has been fixed. We will check with the development team if same has been fixed for .NET and let you know.
Thank you for being patient. We have tested your sample Visio diagram against the latest build of Aspose.Diagram 5.0.0. We managed to replicate the problem of extra white space below the diagram. We have logged this issue under ticket id DIAGRAMNET-50362 in our issue tracking system. Your post has also been linked to this issue. We’ll keep you informed regarding any available updates. We’re sorry for the inconvenience caused.
Thank you for being patient. We have a good news for you that the issue id DIAGRAMNET-50362 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 5.1.0. We’ll inform you via this forum thread as soon as the new release is published.