Toimage creating different sized images on different servers

I am using aspose.cells to create images of a graph and then using that image in a word document through aspose word. I am noticing that the image size that is created differs between my development environment and staging and production environments. The version of aspose.cells and aspose.word is the same on all servers and is currently versuib 7.4.4.0 for cells.

I am starting with a xlsx document where the graph is already built out how we want it and then I am using cells to open that xlsx file and update the values for the graph and convert it to an emf image. I have attached the images from DEV and Staging along with the xlsx file.

If you look at the attached images, you can see that the Dev image has a width of 332, but the Staging image has a width of 372. This causes issues as the word document expects the imges to be a certain size and the extra width is causing display issues. I am having to write specific logic for DEV and Staging to size the images accordingly to work around this.

I would have assumed that since the dlls are the same that there should not be any other difference in the environment that would cause the dll to act differently between servers. Can you think of anything that the dll's would be dependent upon that would cause this issue?

Thanks

Hi,


Thanks for sample files and code segment.

Could you try to set the width/height (using the corresponding attributes) for the chart before taking the image using Chart.ToImage() method if it makes any difference.

E.g

chart.ChartObject.Width = ____;

Thank you.

That seems to work fine.

Thanks for the reply.

Brad

Hi,


Good to know that your issue is sorted out now.

Feel free to contact us any time if you need further help or have some other issue, we will be happy to assist you soon.

Thank you.