Skip to main content

IsFixed

Checks if the current form is fixed size.

Inherited from ApiFormBase.IsFixed.

Syntax​

expression.IsFixed();

expression - A variable that represents an ApiPictureForm class.

Parameters​

This method doesn't have any parameters.

Returns​

boolean

Example​

Determine whether a picture form has a fixed size in a document.

// How do I find out if a picture form is locked to a fixed size in a document?

// Confirm that a picture form cannot be freely resized before processing it 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));
pictureForm.ToFixed(10 * 240, 10 * 240);
let fixed = pictureForm.IsFixed();
paragraph = Api.CreateParagraph();
paragraph.AddText("The first form from this document is fixed: " + fixed);
doc.Push(paragraph);