TRY NEW VERSION

Try now New API BETA

Try out the new view and capabilities of the API documentation

START

Copy

Copy() → { ApiForm }

Inherited From: ApiFormBase#Copy

Copies the current form (copies with the shape if it exists).

Parameters:

This method doesn't have any parameters.

Returns:

Type
ApiForm

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oComboBoxForm = Api.CreateComboBoxForm({"key": "Personal information", "tip": "Choose your country", "required": true, "placeholder": "Country", "editable": false, "autoFit": false, "items": ["Latvia", "USA", "UK"]});
var oParagraph = oDocument.GetElement(0);
oParagraph.AddElement(oComboBoxForm);
var oCopyComboBoxForm = oComboBoxForm.Copy();
oParagraph.AddLineBreak();
oParagraph.AddElement(oCopyComboBoxForm);
builder.SaveFile("docx", "Copy.docx");
builder.CloseFile();

Resulting document