We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Resizing the lateral line shape

I created a new visio diagram and added one shape: lateral line [as I understand this shape comes with Visio]. I modified ChangeShapeSize.java from the examples project to use this object, but it doesn’t resize it at all - the only result is that the form is broken. How can I resize this object?

Regards, Łukasz

Please refer to this link of docs:
If you still have problems, please provide your sample files and code, we will check it soon.

Hi @philip.zhou, this is the code I’m using. It’s just slightly modified [paths and ids] class from your git repository:

package com.aspose.diagram.examples.Shapes;

import com.aspose.diagram.Diagram;
import com.aspose.diagram.Page;
import com.aspose.diagram.SaveFileFormat;
import com.aspose.diagram.Shape;
import com.aspose.diagram.examples.Utils;

public class ChangeShapeSize {

public static void main(String[] args) throws Exception {
    // ExStart:ChangeShapeSize
    // The path to the documents directory.
    String dataDir = "C:\\";

    // call a Diagram class constructor to load the VSDX diagram
    Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx");
    // get page by name
    Page page = diagram.getPages().getPage("Page-1");
    // get shape by id
    //        Shape shape = page.getShapes().getShape(796);
    Shape shape = page.getShapes().getShape(1);
    // alter the size of Shape
    shape.setWidth(10 * shape.getXForm().getWidth().getValue());
    shape.setHeight(2 * shape.getXForm().getHeight().getValue());
    // save diagram
    diagram.save(dataDir + "ChangeShapeSize_Out.vsdx", SaveFileFormat.VSDX);
    // ExEnd:ChangeShapeSize


As you can see the in the output file size is not changed and the form is broken. Should I not be using setWidth/setHeight to resize this object? I don’t see any reference to those methods and any resizing in the link you provided. pack.zip (26.2 KB)


We have logged an investigation ticket as DIAGRAMJAVA-50951 in our issue tracking system to further analyze this case. We will look into ticket detail and let you know once it is resolved. Please be patient and spare us some time.

We apologize for the inconvenience.

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

Hi @philip.zhou, well - the line got resized, yes. But:

  • The form doesn’t cover the whole line now, both ends are somewhere in the middle [at the original positions?] - should I have to add it to the code?
  • When I open the diagram I can no longer resize the line or rotate it or move it…



We have recorded your concerns under the ticket and will perform investigation. We will let you know once we have some feedback.


We have logged another ticket as DIAGRAMJAVA-50967 in our issue tracking system against your recent feedback. We will investigate it and let you know once it is resolved. Please spare us some time.