跳到主要内容

SetSpecialFormat

设置字段的特殊格式。

语法

expression.SetSpecialFormat(format);

expression - 表示 ApiComboboxField 类的变量。

参数

名称必需/可选数据类型默认值描述
format必需PsfFormat应用于值的格式样式

返回值

boolean

示例

在 PDF 中将字段值格式化为电话号码。

// Can I make phone numbers display correctly in a PDF?

// Apply phone number formatting to a field in a PDF.

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

comboboxField.SetSpecialFormat("phone");
comboboxField.SetValue("1234567890");