GetInternalId
返回当前表单的内部 ID。
继承自 ApiFormBase.GetInternalId。
语法
expression.GetInternalId();
expression - 表示 ApiPictureForm 类的变量。
参数
此方法没有任何参数。
返回值
string
示例
读取文档中分配给图片表单的唯一标识符。
// How do I obtain the unique identifier of a picture form in a document?
// Identify a picture form by looking up its internal identifier in a document.
let doc = Api.GetDocument();
let pictureForm = Api.CreatePictureForm({"key": "Personal information", "tip": "Upload your photo", "required": true, "placeholder": "Photo", "scaleFlag": "tooBig", "lockAspectRatio": true, "respectBorders": false, "shiftX": 50, "shiftY": 50});
let paragraph = doc.GetElement(0);
paragraph.AddElement(pictureForm);
pictureForm.SetImage("https://static.onlyoffice.com/assets/docs/samples/img/onlyoffice_logo.png", Api.MillimetersToEmus(70), Api.MillimetersToEmus(80));
let internalId = pictureForm.GetInternalId();
paragraph = Api.CreateParagraph();
paragraph.AddText("Internal id: " + internalId);
doc.Push(paragraph);