DynaPDF Manual - Page 751

Previous Page 750   Index   Next Page 752

Function Reference
Page 751 of 818
If the NeedAppearance flag is set, the viewer uses already its own algorithms to build the field
appearances when opening the file. This avoids visible changes when editing a field. However, the
NeedAppearance flag must not be set to true if a form contains page templates.
Return values:
If the function succeeds the return value is 1. If the function failse the return value is 0.
SetNumberFormat
Syntax:
SI32 pdfSetNumberFormat(
const PPDF* IPDF,
// Instance pointer
UI32 TxtField,
// Text field handle
TDecSeparator Sep,
// Decimal separator
UI32 DecPlaces,
// Number of decimal places
TNegativeStyle NegStyle, // Negative number format
const char* CurrStr,
// Currency string or NULL
LBOOL Prepend)
// Position of Currency string
// Thousand separator, decimal separator
typedef enum
{
dsCommaDot,
dsNoneDot,
dsDotComma,
dsNoneComma,
dsQuoteDot
}TDecSeparator;
typedef enum
{
nsMinusBlack,
nsRed,
nsParensBlack,
nsParensRed
}TNegativeStyle;
The function restricts the allowed input characters of a text field to numbers and formats the
resulting string as specified. A number format is applied via two separate JavaScript actions in PDF
which are automatically created and added to the text field.
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 AFNumber_Keystroke() / AFNumber_Format() to apply a
number format. The functions are described in the JavaScript scripting reference that is available at
https://www.adobe.com.
 

Previous topic: SetMiterLimit, SetNeedAppearance

Next topic: Currency String, Field value

Web links on this page:


Start Chat