Getting less attachment from visio file

Sample code
_children = new Lazy(() =>
{
var cList = new List();
AsposeVisio.PageCollection pages = _document.Pages;
foreach (AsposeVisio.Page page in pages)
{
foreach (AsposeVisio.Shape shape in page.Shapes)
{
var attachmentData = shape.ForeignData;
if (attachmentData.ObjectData != null)
{
Stream str = new MemoryStream(shape.ForeignData.ObjectData);
var fileFormatInfo = AsposeVisio.FileFormatUtil.DetectFileFormat(str);

                    if (fileFormatInfo.FileFormatType == AsposeVisio.FileFormatType.Unknown)
                        cList.Add(new VisioAttachment(shape.ID.ToString(), $"{shape.ID}{Path.GetExtension(attachmentData.ObjectSourceFullName)}", shape));
                    else
                        cList.Add(new VisioAttachment(shape.ID.ToString(), $"{shape.ID}.{fileFormatInfo.FileFormatType}", shape));
                }
            }
        }
        return cList;
    });

-> cannot find the value of attachmentData.ObjectData
You can get a file from the attachment

Less Attachment found.zip (2.9 MB)

@hemalp
We are looking into this scenario and will get back to you soon.
Thanks.

@hemalp
We are sorry we could not find the issue you describe with the file attached.
All objectdata have values.
Sample code:
Diagram diagram = new Diagram(“Less Attachment found.vsd”);
byte[] data = diagram.Pages[0].Shapes.GetShapeIncludingChild(38).ForeignData.ObjectData;
// Three ole object with id 38,39,40 all have values
Console.WriteLine(data.Length);

Please provide a simple project that can reproduce the issue.
Thanks.

Hi @philip.zhou

Can you please check with the new attached file?

Visio Less attachment issue.zip (3.1 MB)

@hemalp
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): DIAGRAMNET-53135

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.

Hello @philip.zhou,

Thank you for your response, we will wait for further updates on the same.

Thank You.

@hemalp
You are welcome.
Please feel free to contact us any time if you find any issue.
Thanks.

Sample code
_children = new Lazy(() =>
{
var cList = new List();
AsposeVisio.PageCollection pages = _document.Pages;
foreach (AsposeVisio.Page page in pages)
{
foreach (AsposeVisio.Shape shape in page.Shapes)
{
var attachmentData = shape.ForeignData;
if (attachmentData.ObjectData != null)
{
Stream str = new MemoryStream(shape.ForeignData.ObjectData);
var fileFormatInfo = AsposeVisio.FileFormatUtil.DetectFileFormat(str);

                    if (fileFormatInfo.FileFormatType == AsposeVisio.FileFormatType.Unknown)
                        cList.Add(new VisioAttachment(shape.ID.ToString(), $"{shape.ID}{Path.GetExtension(attachmentData.ObjectSourceFullName)}", shape));
                    else
                        cList.Add(new VisioAttachment(shape.ID.ToString(), $"{shape.ID}.{fileFormatInfo.FileFormatType}", shape));
                }
            }
        }
        return cList;
    });

[/quote]
-> cannot find the value of attachmentData.ObjectData
You can get a file from the attachment : Visio Less attachment issue.zip (3.1 MB)

@hemalp
This issue is already logged in our database for further investigation. You will be notified here once any update is ready for sharing.
Thanks.

The issues you have found earlier (filed as DIAGRAMNET-53135) have been fixed in this update. This message was posted using Bugs notification tool by philip.zhou

Hello @aspose.notifier

We are still facing same issue.

Thanks

@hemalp
We are sorry we could not find this issue using the latest version for the sample file “Less Attachment.vsd”.
Please check if you are using the latest version 23.5. If you still have issues, please indicate which object is missing data. Please provide a screenshot for reference.
We will check it and get back to you.
Thanks.

Hello @philip.zhou

_children = new Lazy(() =>

{
var cList = new List();
AsposeVisio.PageCollection pages = _document.Pages;
foreach (AsposeVisio.Page page in pages)
{
foreach (AsposeVisio.Shape shape in page.Shapes)
{
var attachmentData = shape.ForeignData;
if (attachmentData.ObjectData != null)
{
Stream str = new MemoryStream(shape.ForeignData.ObjectData);
var fileFormatInfo = AsposeVisio.FileFormatUtil.DetectFileFormat(str);
if (fileFormatInfo.FileFormatType == AsposeVisio.FileFormatType.Unknown)
cList.Add(new VisioAttachment(shape.ID.ToString(), $"{shape.ID}{Path.GetExtension(attachmentData.ObjectSourceFullName)}", shape));
else
cList.Add(new VisioAttachment(shape.ID.ToString(), $"{shape.ID}.{fileFormatInfo.FileFormatType}", shape));
}
}
}
return cList;
});

Not get file extensions in page one of shape 2 in Below Attached vsd File
Visio Less attachment issue.zip (3.1 MB)

@hemalp
Thanks for the template vsd file.
We could find the issue that could not get the source file name or FileFormatType of the ole object in the shape 2 of page 1.
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): DIAGRAMNET-53175

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.

hello @philip.zhou

Any update on this point ?

@hemalp
The issue “DIAGRAMNET-53175” has been resolved now. The fix will be included in an upcoming release (Aspose.Diagram v23.8) that we plan to release in the first half of August 2023. You will be notified when the next version is released.
Thanks.

The issues you have found earlier (filed as DIAGRAMNET-53175) have been fixed in this update. This message was posted using Bugs notification tool by philip.zhou

Hello @philip.zhou

Still facing issue ,now get file extensions in page one of shape 2 but Not get file extensions in page Two of shape 2 and 3 in above mention vsd File.

Thanks

@hemalp
Thank you for your feedback, and we apologize for missing some information.
We reproduced the problems you mentioned in the page two of shape 2 and 3.
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): DIAGRAMNET-53207

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.

The issues you have found earlier (filed as DIAGRAMNET-53207) have been fixed in this update. This message was posted using Bugs notification tool by philip.zhou