跳到主要内容

SetZoom

设置打印工作表时使用的缩放比例(以百分比表示)。设置此属性会关闭“调整为页面大小”模式。

语法​

expression.SetZoom(nZoom);

expression - 表示 ApiPageSetup 类的变量。

参数​

名称必需/可选数据类型默认值描述
nZoom必需number以百分比表示的缩放比例(10-400)。

返回值​

boolean

示例​

设置电子表格中工作表的打印缩放比例(缩放)。

// How do I shrink or enlarge the printout to a percentage of its size in a spreadsheet?

// Scale the printed worksheet to a given percentage in a spreadsheet.

let worksheet = Api.GetActiveSheet();
let pageSetup = worksheet.GetPageSetup();
pageSetup.SetZoom(80);