IsAutoFit
检查文本是否自动适应。
语法
expression.IsAutoFit();
expression - 表示 ApiBaseWidget 类的变量。
参数
此方法没有任何参数。
返回值
boolean
示例
检查 PDF 中控件是否启用了自动文本适配。
// How do I determine if a widget has autofit enabled in a PDF?
// Retrieve and display the autofit status for a widget in a PDF.
let doc = Api.GetDocument();
let page = doc.GetPage(0);
let textField = Api.CreateTextField([10, 10, 160, 30]);
page.AddObject(textField);
textField.AddWidget(0, [10, 40, 160, 60]);
let widgets = textField.GetAllWidgets();
widgets.forEach(function(widget) {
widget.SetAutoFit(true);
});
let bgColor = widgets[0].GetTextColor();
textField.SetValue('Widgets text autofit is: ' + widgets[0].IsAutoFit());