Hello, I am using the latest version of aspose.diagram for Node.js. I’m trying to create a shape with a border and a background color, but these parameters don’t change. I used the next code:
const createMaster = () => {
const master = new Master();
master.setID(0);
master.setName("Rectangle");
const shape = new Shape();
shape.setID(0);
shape.setType(TypeValue.SHAPE);
shape.getXForm().getPinX().setValue(0);
shape.getXForm().getPinY().setValue(0);
shape.getXForm().getWidth().setValue(1);
shape.getXForm().getHeight().setValue(1);
shape.getText().getValue().add(new Txt("Shape"));
shape.getLine().getLineWeight().setValue(0.1);
shape.getLine().getLineColor().setValue("#000000");
shape.getFill().getFillForegnd().setValue("#ffffff");
shape.getFill().getFillBkgnd().setValue("#ffffff");
master.getShapes().add(shape);
return master;
};
const createVisio = () => {
const diagram = new Diagram();
diagram.Title = "My Visio Diagram";
diagram.getMasters().add(createMaster());
diagram.addShape(0, 0, "Rectangle", 0);
diagram.save("output.vsdx", SaveFileFormat.VSDX);
};
And if the shape does not contain text, it is not created.
shape.png (4.7 KB)