Skip to main content

AddWidget

Adds new widget - visual representation for field

Inherited from ApiBaseField.AddWidget.

Example

Add new widget - visual representation for field.

// 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]);