Remove excel personal information using aspose diagram

Hi,

I have a Visio diagram. It contains some ‘Excel’ . We tried to remove excel personal information (Like Author, CreatedTime, Modified date), document properties pro-grammatically. But the info not removed from the excel.
Input: Dialog - 28 - Copy.zip (58.7 KB)

Output: Dialog - 28 - Copy_20200609180258_out.zip (48.1 KB)

Code:

public void TestVisioBigExcel()
{
string[] files = Directory.GetFiles(@“C:\Temp\visio”, “*.vsdx”);
foreach(string file in files)
{
Diagram diagram = new Diagram(file, LoadFileFormat.VSDX);
int nFile = 1;
foreach(Aspose.Diagram.Page diagramPage in diagram.Pages)
{
foreach(Aspose.Diagram.Shape OLE_Shape in diagramPage.Shapes)
{
if(OLE_Shape.Type == Aspose.Diagram.TypeValue.Foreign)
{
if(OLE_Shape.ForeignData.ForeignType == ForeignType.Object)
{
Stream Ole_stream = new MemoryStream(OLE_Shape.ForeignData.ObjectData);
// Get format of the OLE file object
Aspose.Cells.FileFormatInfo info = Aspose.Cells.FileFormatUtil.DetectFileFormat(Ole_stream);
if(info.LoadFormat == Aspose.Cells.LoadFormat.Xlsx)
{
// Modify an OLE object
Workbook workbook = new Aspose.Cells.Workbook(new > MemoryStream(OLE_Shape.ForeignData.ObjectData));
workbook.BuiltInDocumentProperties.Clear();

                                    MemoryStream outStream = new MemoryStream();
                                    workbook.Save(outStream, Aspose.Cells.SaveFormat.Xlsx);

                                    OLE_Shape.ForeignData.ObjectData = outStream.ToArray();
                                    
                                    nFile++;
                                    // Save back an OLE object

                                }
                            }
                        }
                    }
                }


                // Save Visio diagram
                diagram.Save($"C:\\Temp\\visio\\out{DateTime.Now.ToString("yyyyMMddHHmmss")}.vsdx", SaveFileFormat.VSDX);

            }

    }

Reference: image.png (266.0 KB)
Expected Output : image.png (242.5 KB)

Waiting for your support and reply.

Thanks

@msindia

We have logged an issue as DIAGRAMNET-51850 in our issue tracking system for this scenario. We will further investigate it and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.

@asad.ali,

If the ticket is resolved. Please give trail version (dll) for our testing purpose.

Thanks.

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

@asad.ali,

Thanks for the new version. The ticket DIAGRAMNET-51850 is resolved(Only that file is solved).
W have more visio files. These files have issue not removed the Excel personal info and the visio file shown ‘X’ mark.
We have attached some visio files. Please have look.

Input files: Input Files.zip (5.0 MB)
OutPut Files: OutPut Files.zip (1.5 MB)

Ouput in Image: image.png (144.6 KB)

Code: UnitTest7 (2).zip (1.6 KB)

Waiting for yoour support and reply.

Thanks.

@asad.ali,
If the ticket is resolved. Please give trail version (dll) for our testing purpose.

Thanks.

@msindia

You may please test the latest version by applying/using 30-days free temporary license.

@asad.ali,

Thanks for your reply,

We have aspose total licence. We tried with latest version. Please try with below code the problem is exist. If you not getting issue from last attachment files? let us know.
just open and save the visio. it will happen.
Code:
[TestMethod]
public void ConmvertVSDXToVSDX()
{
GetLicense();

        string strInputPath = @"C:\Users\VenkadachalapathyKal\Desktop\VisioInput";
        string strOutputPath = @"C:\Users\VenkadachalapathyKal\Desktop\\VisioExcel\";

        string[] files = Directory.GetFiles(strInputPath, "*.vsdx");

        // Act

        foreach(string strFile in files)
        {
            Diagram vdxDiagram = new Diagram(strFile);
            vdxDiagram.Save(strOutputPath + Path.GetFileNameWithoutExtension(strFile) + ".vsdx", SaveFileFormat.VSDX);
        }
    }

Waiting for your support and reply. please resolved the bug as soon as possible.

Thanks

@msindia

We have noticed the issue in our environment too and are looking into it further. We will let you know about the updates soon.

@asad.ali,

We hope your working on this ticket. If there is any update let us know.

We are waiting for your support and reply.

Thanks.

@msindia

Another ticket as DIAGRAMNET-51863 was created in our issue management system for latest files which you shared with us. The ticket is not yet resolved and under the investigation phase. However, we will inform you as soon as it is resolved. Please spare us some time.

@msindia

We would like to share with you that your issue has been resolved in Aspose.Diagram for .NET 20.6.1 hotfix.

@asad.ali,

Thanks for the trail version. We are started to testing. We will update the status.

Thanks.

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