You are not logged in.
This forum has been archived and no longer accepts new user registrations. Please report your questions, problems, and feedback to the issue page of ReoGrid on GitHub. Thank you for your cooperation.
Pages: 1
Topic closed
Hi.
Please can you help me set my print margins to 1cm all-round (or top and bottom = 1cm, left and right = 1.5cm)
This is what I have tried, but the compiler complains when the value is a fraction (it works if I can set it to 1 inch but not less):
worksheet.PrintSettings.Margins = new unvell.ReoGrid.Print.PageMargins(0.4);
Offline
The PageMargins structure receives inch, to set cm, you have to convert cm to inch, here is an example:
// 1 inch = 2.54 cm
const float cmPreInch = 2.54f;
sheet.PrintSettings.Margins = new PageMargins(1.0f / cmPreInch); // 1cm
Check the result on print settings dialog: 0.39 inch = 0.99 cm
Offline
Thats perfect. Thank you so much.
Offline
Pages: 1
Topic closed