本帖最后由 Fiooona 于 2019-8-26 15:21 编辑
您好这问题一般是因为没有设置好纸张大小paperSize,可以参考下面代码:
- var sheet = spread.getActiveSheet();
- var printInfo = sheet.printInfo();
- printInfo.paperSize(new GC.Spread.Sheets.Print.PaperSize(GC.Spread.Sheets.Print.PaperKind.a4));
- printInfo.margin({ top: 10, bottom: 0, left: 0, right: 0, header: 0, footer: 0 });
- printInfo.showColumnHeader(GC.Spread.Sheets.Print.PrintVisibilityType.hide);//获取或设置是否打印列标题。
- printInfo.showRowHeader(GC.Spread.Sheets.Print.PrintVisibilityType.hide);
- printInfo.orientation(GC.Spread.Sheets.Print.PrintPageOrientation.portrait);//打印的页面方向。portrait纵 landscape
- printInfo.centering(GC.Spread.Sheets.Print.PrintCentering.horizontal);//打印页面的居中方式。
- //是否打印控件的外边框
- printInfo.showBorder(true);
- //是否打印网格线(默认打印)
- printInfo.showGridLine(false);
- spread.print();
复制代码 |