Java - PageSetup is not propagated well

Aspose Cells For Java version (sent by you as a patch)

Code below set things right, but when I open given excel (by Excel 2003 czech version)

I must open Page setup and click ok, to propagate the settings. Ie.
without this step settings I set by code below are visible in page
setup, but haven’t got any impact on how page is printed. It has just
after I click “Ok” button on page setup window. It’s better for me do it
programmatically, without need to make template file with desired
settings predefined. Thank you for your help.

Worksheet sheet = …
PageSetup pageSetup = sheet.getPageSetup();


Since you are using Excel czech version to open the generated file, could you try to check if it works fine in Excel english version. Also, we recommend you to try our latest version( if it make a difference. Moreover, kindly try add the following line to your code if it fixes your issue.



If you still find the issue, kindly provide more details and post your generated file here, we will check it soon.

Thank you.


Thank you for considering Aspose.

This issue is caused by setting the invalid value of PageSetup property, FitToPagesTall. The maximum value of it should be Short.MAX_VALUE and you can check it by setting this property manually in MS Excel.

Anyway, we have changed our component for the API FitToPagesTall/FitToPagesWide. Now, if you give a value greater than Short.MAX_VALUE, we will reset it to Short.MAX_VALUE to keep this property of PageSetup valid.

Please try the attached latest fix.

Thank You & Best Regards,

I set Short.MAX_VALUE instead of Integer.MAX_VALUE and now it seems ok even without the patch. Thank you very much for your support.