自动调整文本框
自动调整文档中的所有文本框大小。
(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);
});
})();
使用方法: GetDocument, GetAllForms, GetFormType, ToFixed, SetAutoFit
结果
