Xojo Conferences
MBSOct2019CologneDE

DynaPDF Manual - Page 641

Previous Page 640   Index   Next Page 642

Function Reference
Page 641 of 766
SetDateTimeFormat
Syntax:
LBOOL pdfSetDateTimeFormat(
const PPDF* IPDF, // Instance pointer
UI32 TxtField,
// Text field handle
TPDFDateTime Fmt) // Date or time format
typedef enum
{
dfMM_D
= 0,
dfM_D_YY
= 1,
dfMM_DD_YY
= 2,
dfMM_YY
= 3,
dfD_MMM
= 4,
dfD_MMM_YY
= 5,
dfDD_MMM_YY
= 6,
dfYY_MM_DD
= 7,
dfMMM_YY
= 8,
dfMMMM_YY
= 9,
dfMMM_D_YYYY
= 10,
dfMMMM_D_YYYY
= 11,
dfM_D_YY_H_MM_TT
= 12,
dfM_D_YY_HH_MM
= 13,
/* time formats */
df24HR_MM
= 14,
df12HR_MM
= 15,
df24HR_MM_SS
= 16,
df12HR_MM_SS
= 17
}TPDFDateTime;
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 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.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
 

Previous topic: SetContent

Next topic: SetDocInfo

Web links on this page: