Vdx file is not able to open in microsoft visio professional 2010

The vdx file created by aspose(5.9.0) is not opened in visio 2010. There are several logs shown. Below are the logs.

[Warning] DataType:
Context: Line 1 — ID=‘6’
Description: This file contains a duplicate of an element that can exist only once. Visio has ignored the duplicate element.

[Warning] DataType:
Context: LineStyle=…
Description: The style reference is invalid. The object does not exist or is not a style. Visio has substituted an appropriate value.
Attribute: LineStyle
Old value: 8
New value: 0

[Warning] DataType:
Context: FillStyle=…
Description: The style reference is invalid. The object does not exist or is not a style. Visio has substituted an appropriate value.
Attribute: FillStyle
Old value: 8
New value: 0

[Warning] DataType:
Context: TextStyle=…
Description: The style reference is invalid. The object does not exist or is not a style. Visio has substituted an appropriate value.
Attribute: TextStyle
Old value: 8
New value: 0

[Warning] DataType:
Context: Line 1 —
Description: An element in this file contains data that is invalid or inappropriate for the expected type of data. Visio has substituted an appropriate value.

@maneeshk82

Thanks for contacting support.

I am afraid that you are using quite old version of the API - whereas, it is always recommended to use latest version, because it contains more fixes and enhancements. We request you to please use Aspose.Diagram for .NET 18.6, and in case you still face any issue, please share your complete code snippet along with input/output files. We will test the scenario in our environment and address it accordingly.

Hello Asad,

We are using latest version18.6 aspose sdk jar for java. Please find below code and attached input and output files in zip document. Please note that output.vdx file is not properly opening in Microsoft Visio Professional 2010. Input_Output_Files.zip (285.0 KB)

public class Connections {
  public static void main(String...args) throws Exception{
    String dataDir = Utils.getSharedDataDir(ApplyCustomStyleSheets.class) + "Connections/";
    Diagram diagram = new Diagram(dataDir + "Base.vsdx");
    Page page = diagram.getPages().get(0);


    Diagram masterFile = new Diagram(dataDir + "topology.vss");
    ArrayList<String> lst= new ArrayList<String>();
    for (Master m: (Iterable<Master>)masterFile.getMasters()) {
      diagram.addMaster(masterFile, m.getName());
      lst.add(m.getName());
    }
    
    int shapeCount = 8;
    
    List<Long> sVertex = new ArrayList<Long>();
    List<Long> dVertex = new ArrayList<Long>();
    double x=5.5,y=5.5;
    for(int i=0;i<shapeCount;i++){
      Shape shape = new Shape();
      shape.getXForm().getPinX().setValue(x);
      shape.getXForm().getPinY().setValue(y);
      long shape1_ID = page.addShape(shape, "Circle");
      if(i%2==0){
        sVertex.add(shape1_ID);
      }
      else {
        dVertex.add(shape1_ID);
      }
      x += 0.5;
      y += 0.5;
    }
    
    for(int j=0;j<sVertex.size() && j<dVertex.size();j++){
      Shape connector1 = new Shape();
      long connecter1Id = diagram.addShape(connector1, "Dynamic Connector", 0);
      page.connectShapesViaConnector(sVertex.get(j), ConnectionPointPlace.CENTER,
        dVertex.get(j), ConnectionPointPlace.CENTER, connecter1Id);
    }
    DiagramSaveOptions options = new DiagramSaveOptions(SaveFileFormat.VDX);
    // set Auto fit page property
    options.setAutoFitPageToDrawingContent(true);
    diagram.save(dataDir + "output.vdx", options);
  }
}

@maneeshk82

We have tested the scenario using Aspose.Diagram for Java 18.7 and tried to open the output file in Visio Viewer 2010. The file was visible in the viewer as in this screenshot VisioViewer 2010.png (29.0 KB). Would you please share a screenshot showing the problem while opening output VDX file in Microsoft Visio Professional 2010. We will further check details and assist you accordingly.

@asad.ali

The screen shot attached is related to visio viewer. In visio viewer warnings get ignored and don’t show log message. You can check that shapes is having dark background that is wrong.
Please find attached screen shot of visio professional.visio_2010_professional.png (127.6 KB)
The main issue is that Base.vdx file not supported to visio 2010.
Please find attached zip of logs and please try to open the output.vdx in Visio Professional 2010. VSO4D82.zip (857 Bytes)

@maneeshk82

Thanks for sharing more details.

We were also able to observe the issue in our environment and logged this issue as DIAGRAMJAVA-50612 in our issue tracking system. We will further check the issue in details and keep you informed with the status of its correction. Please be patient and spare us little time.

We are sorry for the inconvenience.

The issues you have found earlier (filed as DIAGRAMJAVA-50612) have been fixed in this update. This message was posted using BugNotificationTool from <a href=“https://#{request.env[“HTTPS_HOST”]}”>Downloads module by Farhan.Raza