Embedded OLE objects not stored correctly in Shape properties

As per attached sample, if you execute the following against the .vsd file

using var diagram = new Aspose.Diagram.Diagram(path);
var shape = diagram.Pages[0].Shapes[3];
var foreignData = shape.ForeignData;
Console.WriteLine($"ImageData.Length={foreignData.ImageData?.Length}"); // 100,864 bytes => incorrect, this is greater than the 93,299 bytes in the PDF and appears to be both the image bytes and the PDF object bytes but there is no common byte offset to use to extract the PDF bytes
Console.WriteLine($"ObjectData.Length={foreignData.ObjectData?.Length}"); // null => incorrect
Console.WriteLine($"ImageData.Length={foreignData.ObjectType}"); // EmbeddedObject | OLE2Object

You can see that OLE objects that are embedded are not being correctly mapped. ObjectData should not be null and ImageData should be the icon image data bytes only.

has_pdf_sample.zip (118.1 KB)


We were able to notice the issue in our environment while testing the scenario with Aspose.Diagram for .NET 20.11. Hence, have logged it as DIAGRAMNET-51962 in our issue tracking system. We will further look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.

No problem. Thank you for the update

Please try the latest version 21.1,This issue should have been fixed,thanks