How to remove the 'whitespace' of a diagram in a page

Dear Support,

I am using Aspose.Diagram for .NET version 24.8.0 in C#.

I have a question regarding to remove the ‘whitespace’ of a diagram in a page.

In Visio this was done by selecting all the shapes on the page and copy them to a new page, so that the ‘virtual’ rectangle is positioned at the top left corner of the page.

My question is how to do this with Aspose.Diagram. So all the shapes have to move somewhat to the left and top so that there is no ‘whitespace’ in the diagram of the page.

I hope the hear soon from you to get some hints.

With Kind Regards,

Thierry Knijff

@tkn1967

Can you please provide more details about the specific version of Aspose.Diagram you are using and any code snippets you have tried so far?

I am using Aspose.Diagram for .NET version 24.8.0

I have nothing tried yet. I would like to have some suggestions on how to move the diagram to the top, left of the page so the ‘whitespace’ is removed.

@tkn1967
Please try the following code: First, group the required shapes, and then you can perform subsequent operations such as moving or copying this group shape to a new page, or directly generating an image.

        var list = new List<Shape>();
        foreach (Shape shape in diagram.Pages[0].Shapes)
        {
            list.Add(shape);
        }
        Shape s = diagram.Pages[0].Shapes.Group(list.ToArray());

Thanks.

1 Like

Hi Philip,

I am using version 25.3.1 of Aspose Diagram.

Unfortunately, I saw that some Visio Template files introduces some ‘white space’ which were not present in earlier versions (in version 24.12.0 of Aspose Diagram this didn’t occur.

Hereby the generated pictures (svg-format) in zipfiles:

Hereby the corresponding Visio Template files in zipfiles:

Can you have a look on this, please?
I am also curious what the root cause of this issue is, because in earlier versions this was working as expected.

Kind Regards,

Thierry Knijff
Software Engineer

@tkn1967
Thanks for the template files and output svgs.
We apologize for any inconvenience caused.
We will improve our algorithm by adding more test cases.
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-53697

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.