Skip to main content

GetClassType

Returns a type of the ApiPictureForm class.

Syntax

expression.GetClassType();

expression - A variable that represents a ApiPictureForm class.

Parameters

This method doesn't have any parameters.

Returns

"pictureForm"

Example

This example gets a class type and inserts it into the document.

// How to get a class type of ApiPictureForm.

// Retrieve class type of ApiPictureForm object and insert it to the 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://api.onlyoffice.com/content/img/docbuilder/examples/user-profile.png");
let classType = pictureForm.GetClassType();
paragraph = Api.CreateParagraph();
paragraph.AddText("Class type: " + classType);
doc.Push(paragraph);