Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 11.0   11.1   11.2   11.3   11.4   11.5   12.0   12.1   12.2   12.3    Statistic    FMM    Blog  

DynaPDF.SetDateTimeFormat

Sets field to use date format.

Component Version macOS Windows Linux Server iOS SDK
DynaPDF 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "DynaPDF.SetDateTimeFormat"; PDF; Field; DateFormat )   More

Parameters

Parameter Description Example
PDF The PDF reference returned from DynaPDF.New. $pdf
Field The field index or field name. "Birthday"
DateFormat The new date format. "MM_DD_YY"

Result

Returns OK or error.

Description

Sets field to use date format.
The function restricts the allowed value of a text field to a date time format and applies this format if the value was valid. A date time format is represented as two separate JavaScript actions in PDF which are automatically created and added to the text field by this function.
The same formats can also be applied manually by creating two JavaScript actions, one for the OnKeyStroke event, and one for the OnFormat event of the text field. See DynaPDF.AddActionToObj for a description of the events.
DynaPDF uses the JavaScript functions AFDate_Keystroke() / AFDate_KeystrokeEx() and AFDate_Format() / AFDate_FormatEx() to apply a date time format. The functions are described in the JavaScript scripting reference which is available at http://www.adobe.com.

Format can be one of: MM_D, M_D_YY, MM_DD_YY, MM_YY, D_MMM, D_MMM_YY, DD_MMM_YY, YY_MM_DD, MMM_YY, MMMM_YY, MMM_D_YYYY, MMMM_D_YYYY, M_D_YY_H_MM_TT, M_D_YY_HH_MM, 24HR_MM, 12HR_MM, 24HR_MM_SS, 12HR_MM_SS,.

See also SetDateTimeFormat function in DynaPDF manual.

See also

Release notes

  • Version 12.3
    • Added DynaPDF.SetDateTimeFormat function.

Created 9th June 2022, last changed 9th June 2022


DynaPDF.SetContent - DynaPDF.SetDocInfo

Feedback: Report problem or ask question.


Start Chat