ToFixed
将当前表单转换为固定大小的表单。
语法
expression.ToFixed(width, height, keepPosition);
expression - 表示 ApiComboBoxForm 类的变量。
参数
| 名称 | 必需/可选 | 数据类型 | 默认值 | 描述 |
|---|---|---|---|---|
| width | 必需 | twips | 包装形状的宽度,以点的二十分之一为单位(1/1440 英寸)。 | |
| height | 必需 | twips | 包装形状的高度,以点的二十分之一为单位(1/1440 英寸)。 | |
| keepPosition | 必需 | boolean | 保存在页面上的位置(可能会稍慢,因为需要运行文档计算)。 |
返回值
boolean
示例
此示例将表单转换为固定大小的表单。
// How to fix the size of the text form.
// Create a text form and make the size of it fixed.
let doc = Api.GetDocument();
let textForm = Api.CreateTextForm({"key": "Personal information", "tip": "Enter your first name", "required": true, "placeholder": "First name", "comb": true, "maxCharacters": 10, "cellWidth": 3, "multiLine": false, "autoFit": false});
let paragraph = doc.GetElement(0);
paragraph.AddElement(textForm);
textForm.ToFixed(10 * 240, 2 * 240);
let fixed = textForm.IsFixed();
paragraph = Api.CreateParagraph();
paragraph.AddText("The first form from this document has a fixed size: " + fixed);
doc.Push(paragraph);