跳到主要内容

SetScrollLongText

设置文本字段是否可以滚动长文本。

语法

expression.SetScrollLongText(allowScroll);

expression - 表示 ApiTextField 类的变量。

参数

名称必需/可选数据类型默认值描述
allowScroll必需boolean指定长文本是否可以滚动。

返回值

boolean

示例

当文本超过 PDF 中字段宽度时允许水平滚动。

// How do I make a narrow text field scrollable for longer content in a PDF?

// Enable scrolling for text that overflows the field boundary in a PDF.

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

textField.SetScrollLongText(true);
textField.SetValue('Scroll long text property is: ' + textField.IsScrollLongText());