Get Started
Usage API
More information

Api

new Api()

Base class

Methods

Name Description
CreateCheckBoxForm

Creates a checkbox/radio button form with the specified checkbox/radio button form properties.

CreateComboBoxForm

Creates a combo box/dropdown form with the specified combo box/dropdown form properties.

CreatePictureForm

Creates a picture form with the specified picture form properties.

CreateTextForm

Creates a text form with the specified text form properties.

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oTextForm = Api.CreateTextForm({"key": "Personal information", "tip": "Enter your first name", "required": true, "placeholder": "First name", "comb": true, "maxCharacters": 10, "cellWidth": 3, "multiLine": false, "autoFit": false});
var oParagraph = oDocument.GetElement(0);
oParagraph.AddElement(oTextForm);
oParagraph.AddLineBreak();
var oComboBoxForm = Api.CreateComboBoxForm({"key": "Personal information", "tip": "Choose your country", "required": true, "placeholder": "Country", "editable": false, "autoFit": false, "items": ["Latvia", "USA", "UK"]});
oParagraph = oDocument.GetElement(0);
oParagraph.AddElement(oComboBoxForm);
oParagraph.AddLineBreak();
var oCheckBoxForm = Api.CreateCheckBoxForm({"key": "Marital status", "tip": "Specify your marital status", "required": true, "placeholder": "Marital status", "radio": true});
oParagraph = oDocument.GetElement(0);
oParagraph.AddElement(oCheckBoxForm);
oParagraph.AddText(" Married");
oParagraph.AddLineBreak();
oCheckBoxForm = Api.CreateCheckBoxForm({"key": "Marital status", "tip": "Specify your marital status", "required": true, "placeholder": "Marital status", "radio": true});
oParagraph.AddElement(oCheckBoxForm);
oParagraph.AddText(" Single");
oParagraph.AddLineBreak();
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});
oParagraph = oDocument.GetElement(0);
oParagraph.AddElement(oPictureForm);
builder.SaveFile("docx", "Api.docx");
builder.CloseFile();

Resulting document