跳到主要内容

SetValue

为签名表单设置图像。

语法

expression.SetValue(value);

expression - 表示 ApiSignatureForm 类的变量。

参数

名称必需/可选数据类型默认值描述
value必需string图像源(URL 或 base64 编码图像)。

返回值

boolean

示例

// The SetValue method of ApiSignatureForm is a shorthand for SetImage that fits the unified value interface.

// Create a signature form and assign a signature image from a URL using SetValue.

let doc = Api.GetDocument();
let signatureForm = Api.CreateSignatureForm({"key": "Signature", "tip": "Please sign here", "required": true, "placeholder": "Signature"});
let paragraph = doc.GetElement(0);
paragraph.AddElement(signatureForm);
signatureForm.SetValue("https://static.onlyoffice.com/assets/docs/samples/img/onlyoffice_logo.png");