BOOL32 __stdcall pdfSetDateTimeFormat(PPDF IPDF, uint32_t TxtField, int32_t Fmt);
function pdfSetDateTimeFormat(const IPDF: PPDF; TxtField: Cardinal; Fmt: Integer): LongBool; stdcall;
Purpose. Give a text field Acrobat-standard date/time input formatting via AFDate_FormatEx/AFDate_KeystrokeEx JS actions — the same /AA F//AA K mechanism as pdfSetNumberFormat above.
Description. Only two Fmt values map to a distinct picture string — every other value (including 0) collapses to the same default. Fmt = 1 → "mm/dd/yyyy"; Fmt = 2 → "yyyy-mm-dd"; anything else (the else branch, covering 0, negative values, and any value > 2) → "yyyy-mm-dd HH:MM:ss". There is no error path for an unrecognized Fmt — it is treated identically to the default.
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
TxtField | Target text field handle. |
Fmt | 1 = mm/dd/yyyy, 2 = yyyy-mm-dd, anything else = yyyy-mm-dd HH:MM:ss. |
Return value. True if TxtField resolves to a known field; False otherwise.
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Setters
pdfSetDateTimeFormat
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.