Posted 13 November 2019, 1:30 am EST
Hello,
How to set margins when printing ?
thank you
Forums Home / Spread / SpreadJS
Posted by: rmoulin on 13 November 2019, 1:30 am EST
Posted 13 November 2019, 1:30 am EST
Hello,
How to set margins when printing ?
thank you
Posted 13 November 2019, 4:00 pm EST
Hi Raphael,
You could set the margins by using the margin method of the printInfo object. Please refer to the following code snippet:
// get sheet's print info
var printInfo = sheet.printInfo();
// update margins
var curMargins = printInfo.margin();
curMargins.top = 150;
curMargins.left = 150;
printInfo.margin(curMargins);
API Reference:
• printInfo Method: https://www.grapecity.com/spreadjs/docs/v13/online/SpreadJS~GC.Spread.Sheets.Worksheet~printInfo.html
• margin method: https://www.grapecity.com/spreadjs/docs/v13/online/SpreadJS~GC.Spread.Sheets.Print.PrintInfo~margin.html
Also when printing, the browser may add margins of its own so make sure that margins are set to none in browser’s print settings.
Regards
Sharad
Posted 13 November 2019, 5:51 pm EST
Thank you,
this is exactly what I was looking for
best regards