Skip to main content

SetLayout

Sets button widget layout type

Syntax

expression.SetLayout(layout);

expression - A variable that represents a ApiButtonWidget class.

Parameters

NameRequired/OptionalData typeDefaultDescription
layoutRequiredButtonLayoutThe button layout.

Returns

boolean

Example

Set button widget layout type in a PDF document.

// Apply layout type such as 'iconTextV' to a button widget.

// Display the set layout value using the widget label.

let doc = Api.GetDocument();
let page = doc.GetPage(0);
let buttonField = Api.CreateImageField([10, 10, 120, 100]);
page.AddObject(buttonField);

let widgets = buttonField.GetAllWidgets();
widgets[0].SetLayout('iconTextV');
widgets[0].SetLabel('Layout is: ' + widgets[0].GetLayout());