跳到主要内容

CreateRadiobuttonField

创建单选按钮字段。

语法

expression.CreateRadiobuttonField(aRect);

expression - 表示 Api 类的变量。

参数

名称必需/可选数据类型默认值描述
aRect必需Rect控件矩形

返回值

ApiRadiobuttonField

示例

如何创建单选按钮字段并添加到文档。

// How do I create the radiobutton field in a PDF document?

// Create the radiobutton field and display the result in a PDF document.

let doc = Api.GetDocument();
let page = doc.GetPage(0);

let radioField = Api.CreateRadiobuttonField([10, 10, 25, 25]);
page.AddObject(radioField);
radioField.AddOption(0, [10, 30, 25, 45], 'Choice 2');
radioField.SetValue('Choice 2');