Xojo Conferences
MBSOct2019CologneDE
XDCMarch2020NashvilleUS

DynaPDF Manual - Page 645

Previous Page 644   Index   Next Page 646

Function Reference
Page 645 of 770
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: SetCompressionLevel, SetContent

Next topic: SetDefBitsPerPixel, SetDocInfo

Web links on this page: