CreatePictureForm

CreatePictureForm(oFormPr) → { ApiPictureForm }

Creates a picture form with the specified picture form properties.

Parameters:

Name Type Description
oFormPr PictureFormPr

Picture form properties.

Returns:

Type
ApiPictureForm

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oPictureForm = Api.CreatePictureForm({"key": "Personal information", "tip": "Upload your photo", "required": true, "placeholder": "Photo", "scaleFlag": "tooBig", "lockAspectRatio": true, "respectBorders": false, "shiftX": 50, "shiftY": 50});
var oParagraph = oDocument.GetElement(0);
oParagraph.AddElement(oPictureForm);
oPictureForm.SetImage("https://api.onlyoffice.com/content/img/docbuilder/examples/user-profile.png");
builder.SaveFile("docxf", "CreatePictureForm.docxf");
builder.CloseFile();

Resulting document