@workshare,
The height/width swapping issue is not there when I used your newly attached template file. I again tested your scenario/ case using the following sample code with your template file and it works find. I could not find any issue regarding size (height, width, etc.) and other formattings attributes. I have attached the output images in the zipped archive and also pasted the console output for your reference:
e.g
Sample code:
Workbook workbook = new Workbook("e:\\test2\\ShapeRotationModified.xlsx");
Worksheet sheet = workbook.Worksheets[0];
int i = 0;
//Get the first shape in the worksheet.
foreach (var shape in sheet.Shapes)
{
//If the first shape is rectangle shape.
if (shape.GetType().ToString() == "Aspose.Cells.Drawing.RectangleShape")
{
i++;
Aspose.Cells.Drawing.RectangleShape rec = (Aspose.Cells.Drawing.RectangleShape)shape;
Console.WriteLine(rec.Name + ":");
string place = rec.Placement.ToString();
Console.WriteLine("Placement: "+ place);
double lnwt = rec.LineFormat.Weight;
Console.WriteLine("Border line wt:" + lnwt);
double width = rec.WidthCM;
Console.WriteLine("Width: " + width);
double height = rec.HeightCM;
Console.WriteLine("Height: " + height);
double angle = rec.RotationAngle;
Console.WriteLine("Rotation angle: " + angle);
rec.ToImage("e:\\test2\\outshp" + i.ToString()+ ".png", new ImageOrPrintOptions() { ImageType = ImageType.Png });
Console.WriteLine("----------- ");
}
}
Rectangle 5:
Placement: MoveAndSize
Border line wt:0.5
Width: 3.04270833333333
Height: 2.09020833333333
Rotation angle: 315
Rectangle 6:
Placement: MoveAndSize
Border line wt:0.5
Width: 2.09020833333333
Height: 3.04270833333333
Rotation angle: 240
Rectangle 7:
Placement: MoveAndSize
Border line wt:0.5
Width: 2.09020833333333
Height: 3.04270833333333
Rotation angle: 120
Rectangle 8:
Placement: MoveAndSize
Border line wt:0.5
Width: 3.04270833333333
Height: 2.09020833333333
Rotation angle: 15
I am using latest version/fix: Aspose.Cells for .NET v19.1.5 (attached). If you find any issue with v19.1.5, let me know with sample code (runnable) and template file, we will check it soon.
Moreover, with each release and fix, we do enhance reading/writing, parsing and rendering shapes module. So, using latest version/fix would be always better.
files1.zip (9.5 KB)
Aspose.Cells19.1.5 For .Net2_AuthenticodeSigned.Zip (4.7 MB)
Aspose.Cells19.1.5 For .Net4.0.Zip (4.8 MB)
PS. I guess I found Rectangle 6 and Rectangle 7 have swapping issue for width and height attributes. We will look into it soon.