跳到主要内容

AddWidget

添加新控件 - 字段的可视化表示

继承自 ApiBaseField.AddWidget

示例

添加新控件——字段的可视表示。

// How to add the widget for a base field in a PDF document?

// Add the widget and display the result in a PDF document.

let doc = Api.GetDocument();
let page = doc.GetPage(0);
let textField = Api.CreateTextField([10, 10, 160, 30]);
page.AddObject(textField);

textField.SetValue('Example text');
textField.AddWidget(0, [10, 40, 160, 60]);