卡死的原因是:设置了重复打印,而重复打印的内容超出一页纸(超出部分又会重复打印),所以无限循环。
按照我下面的设置,不会分页,也不会卡死:
var sheet = spread.sheets[0];
var rowCount = sheet.getRowCount();
var colCount = sheet.getColumnCount();
var printf = sheet.printInfo();
printf.margin({top:0, bottom:0, left:0, right:0, header:0, footer:0});
printf.orientation(GC.Spread.Sheets.Print.PrintPageOrientation.landscape);
printf.showGridLine(false);
printf.showRowHeader(GC.Spread.Sheets.Print.PrintVisibilityType.hide);
printf.showColumnHeader(GC.Spread.Sheets.Print.PrintVisibilityType.hide);
printf.paperSize(new GC.Spread.Sheets.Print.PaperSize(GC.Spread.Sheets.Print.PaperKind.a4));
printf.zoomFactor(0.7)
浏览器打印时将浏览器打印设置的边距调成无,方向设置为横向打印。
|