This one is quite a weird and complex one and difficult to replicate but causes massive problems.
Aspose being server-side compatible we run it inside a service; in Windows this gives the process session 0. Here is a quick article explaining sessions in Windows:
However, on a certain hardware Aspose.Slides gives us different (wrong) values for StandardHeight and StandardWdith when run in session 0 as opposed to session 1. This causes the output file to also have its height and width reset to the wrong one!
To test, you can use any Excel Workbook, although I have attached one for convenience.
Running the following code:
var book = new Workbook(“Test.xlsx”); Console.WriteLine(book.Worksheets.Cells.StandardHeight); Console.WriteLine(book.Worksheets.Cells.StandardWidth);
In session 1:
This seems to be the correct value.
When running in session 0 I get:
To run the program in session 0 you can use the following command as administrator to open up a session 0 session
psexec.exe –s –i 0 cmd.exe
Now the caveat here is that not all hardware we run it on produces the incorrect result. So it would be nice if you could check with engineers what the probable cause of this could be.