自动调整文本框
自动调整文档中的所有文本框大小。
(function () {
let doc = Api.GetDocument();
let width = 6 * 240;
let height = 2 * 240;
// 所有文本框的自动调整属性设置为true
doc.GetAllForms()
.filter(form => form.GetFormType() === "textForm")
.forEach(form => {
form.ToFixed(width, height);
form.SetAutoFit(true);
});
})();
使用方法:获取文档,获取所有表单, 获取表单类型,固定尺寸,设置自动调整
结果