TRY NEW VERSION

Try now New API BETA

Try out the new view and capabilities of the API documentation

START

GetFormat

GetFormat() → { string }

Gets the date format of the current form.

Parameters:

This method doesn't have any parameters.

Returns:

Type
string

Example

Copy code
builder.CreateFile(pdf);
var oDocument = Api.GetDocument();
var oDateForm = Api.CreateDateForm({"key": "Nowadays", "tip": "Enter current date", "required": true, "placeholder": "Date", "format": "mm.dd.yyyy", "lang": "en-US"});
var oParagraph = oDocument.GetElement(0);
oParagraph.AddElement(oDateForm);
oDateForm.SetFormat("mm/dd/yyyy");
var sFormat = oDateForm.GetFormat();
oParagraph = Api.CreateParagraph();
oParagraph.AddText("Date format: " + sFormat);
oDocument.Push(oParagraph);
builder.SaveFile("pdf", "GetFormat.pdf");
builder.CloseFile();

Resulting document