Get Started
Usage API
More information

Copy

Copy() → { null | ApiTextForm | ApiCheckBoxForm | ApiComboBoxForm | ApiPictureForm }

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
null | ApiTextForm | ApiCheckBoxForm | ApiComboBoxForm | 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);
var oCopyPictureForm = oPictureForm.Copy();
oParagraph.AddLineBreak();
oParagraph.AddElement(oCopyPictureForm);
builder.SaveFile("docx", "Copy.docx");
builder.CloseFile();

Resulting document