Terminator shape bumed from one side. and it is shrinked from another side

Hi Team,

I am using Aspose diagram to create the visio and converting visio to pdf.

Cdde snippet-
image.png (134.8 KB)

Issue I am getting
image.png (4.2 KB)

The shape I am expecting
image.png (4.1 KB)

Package I am using
image.png (5.5 KB)

I hav tried below code as well to maintain the aspect ratio (width/height) = 2

if (node[“shape”].ToString() == “Start/End”)
{
width = desiredWidth;
height = width / 2;
}

but this makes it even worse. as given below.

image.png (2.5 KB)

@rohithajare

It sounds like you’re experiencing issues with the aspect ratio of a shape when using Aspose.Diagram to create Visio files and convert them to PDF. To resolve this, you should set the AspectRatioLocked property to true. This will ensure that the shape’s dimensions are adjusted proportionally when you change either the width or height.

Here’s a code snippet to help you implement this:

// Assuming 'shape' is your shape object
shape.AspectRatioLocked = true;

// Set the desired width and height
if (node["shape"].ToString() == "Start/End")
{
    width = desiredWidth;
    height = width / 2; // Maintain aspect ratio of 2:1
    shape.Width = width;
    shape.Height = height;
}

Make sure to apply this setting before saving or converting your diagram to PDF. If the shape still appears distorted, double-check the dimensions you’re setting and ensure that the shape type supports aspect ratio locking.

To proceed, implement the code snippet and test the output. If you continue to face issues, please provide additional details about the shape type or any error messages you encounter. I’m here to help!

Thanks for the repose,

I already have tried above provided solution which did not work in my case.

I tried to find shape.AspectRatioLocked = true; property in Digram shape. bet seems like it is not part of aspose.diagram.shape

@rohithajare
Thanks for the screenshots.
It seems you want to change the connector line from a polyline to a straight line. Please try using the following code to set the properties of this connector line before connect shapes.

connector.Layout.ShapeRouteStyle.Value = ShapeRouteStyleValue.Straight;

If you still experience the same issue, then please provide us a demo console application with the template file that should help us to reproduce the issue on our end.

Thanks.

Hi the issue is with terminator and its bumped shape please suggest a solution regarding same . no issue seen with connector
{878B248F-6B94-4C40-B7D6-AFF05C369F75}.png (6.4 KB)

@prathmeshg
Please provide us a demo console application that should help us to reproduce the issue on our end .
Or could you please share the template file and sample code?
Thanks.

@prathmeshg
Thanks for sharing the sample code.
Unfortunately, we’re unable to execute the code successfully as we’re missing the following required file: “Templates/Flowchart/clara_stencil.vssx”.
Please also share the template file “Templates/Flowchart/clara_stencil.vssx” to make the code run successfully.
Thanks.

clara_stencil.zip (47.7 KB)

@prathmeshg
Thanks for the template file.

We called this interface “GenerateFile” in the code, but unfortunately it threw an exception “Invalid data for diagram generation”. After commenting out this code section, we encountered another error: ‘Master with name Hexagon does not exist in the collection of Masters’. There’s no master named “Hexagon” in the file “clara_stencil.vssx”.Upon removing this problematic portion, we finally succeeded in generating the PDF. We couldn’t reproduce the issue you described.

Please check the generated PDF file - could there be an issue with our calling method or other implementation aspects?
out.pdf (102.7 KB)

Could you please create a standalone console application (runnable), zip the project and post us?We will evaluate your issue further.

Please see attached file for more details
demo.zip (10.5 KB)

@prathmeshg
Thanks for the json file and codes.

Unfortunately, the code is missing some methods, such as HttpRequestUtility and DynamicTypeParser, so we are unable to run the entire program. It would be better if you could provide these methods or a simple runnable project.

Thanks.

Hi can you please share details on code which was removed and there by not reproducing the issue

@prathmeshg

We’ve commented out some code sections, but since the JSON data reading functionality hasn’t been implemented, these modifications should effectively be non-functional.
We also noticed that several masters have been added in your newly shared code that were not present in the original VSSX file.
Please review accordingly.
Thanks.
code.zip (6.3 KB)