com.spire.pdf.actions
Class PdfJavaScript

java.lang.Object
  extended by com.spire.pdf.actions.PdfJavaScript

public class PdfJavaScript
extends java.lang.Object

The Adobe Built-in JavaScript


Constructor Summary
PdfJavaScript()
           
 
Method Summary
static java.lang.String getDateFormatString(java.lang.String cFormat)
          Get a AFDate_FormatEx string
static java.lang.String getDateKeystrokeString(java.lang.String cFormat)
          Get a AFDate_KeystrokeEx string
static java.lang.String getNumberFormatString(int nDec, int sepStyle, int negStyle, int currStyle, java.lang.String strCurrency, boolean bCurrencyPrepend)
          Get a AFNumber_Format string
static java.lang.String getNumberKeystrokeString(int nDec, int sepStyle, int negStyle, int currStyle, java.lang.String strCurrency, boolean bCurrencyPrepend)
          Get a AFNumber_Keystroke string
static java.lang.String getPercentFormatString(int nDec, int sepStyle)
          Get a AFPercent_Format string
static java.lang.String getPercentKeystrokeString(int nDec, int sepStyle)
          Get a AFPercent_Keystroke string
static java.lang.String getRangeValidateString(boolean bGreaterThan, float nGreaterThan, boolean bLessThan, float nLessThan)
          Get a AFRange_Validate string
static java.lang.String getSimpleCalculateString(java.lang.String cFunction, java.lang.String... cFields)
          Get a AFSimple_Calculate string
static java.lang.String getSpecialFormatString(int psf)
          Get a AFSpecial_Format string
static java.lang.String getSpecialKeystrokeString(int psf)
          Get a AFSpecial_Format string
static java.lang.String getTimeFormatString(int ptf)
          Get a AFTime_Format string
static java.lang.String getTimeKeystrokeString(int ptf)
          Get a AFTime_Keystroke string
 

Constructor Detail

PdfJavaScript

public PdfJavaScript()
Method Detail

getNumberFormatString

public static java.lang.String getNumberFormatString(int nDec,
                                                     int sepStyle,
                                                     int negStyle,
                                                     int currStyle,
                                                     java.lang.String strCurrency,
                                                     boolean bCurrencyPrepend)
Get a AFNumber_Format string

Parameters:
nDec - The number of places after the decimal point
sepStyle - The integer denoting whether to use a separator or not. If sepStyle=0, use commas. If sepStyle=1, do not separate.
negStyle - The formatting used for negative numbers: 0 = MinusBlack, 1 = Red, 2 = ParensBlack, 3 = ParensRed
currStyle - The currency style - not used
strCurrency - The currency symbol
bCurrencyPrepend - True to prepend the currency symbol; false to display on the end of the number

getNumberKeystrokeString

public static java.lang.String getNumberKeystrokeString(int nDec,
                                                        int sepStyle,
                                                        int negStyle,
                                                        int currStyle,
                                                        java.lang.String strCurrency,
                                                        boolean bCurrencyPrepend)
Get a AFNumber_Keystroke string

Parameters:
nDec - The number of places after the decimal point
sepStyle - The integer denoting whether to use a separator or not. If sepStyle=0, use commas. If sepStyle=1, do not separate.
negStyle - The formatting used for negative numbers: 0 = MinusBlack, 1 = Red, 2 = ParensBlack, 3 = ParensRed
currStyle - The currency style - not used
strCurrency - The currency symbol
bCurrencyPrepend - True to prepend the currency symbol; false to display on the end of the number

getRangeValidateString

public static java.lang.String getRangeValidateString(boolean bGreaterThan,
                                                      float nGreaterThan,
                                                      boolean bLessThan,
                                                      float nLessThan)
Get a AFRange_Validate string

Parameters:
bGreaterThan - Indicate the use of the greater than comparison
nGreaterThan - The value to be used in the greater than comparison
bLessThan - Indicate the use of the less than comparison
nLessThan - The value to be used in the less than comparison

getPercentFormatString

public static java.lang.String getPercentFormatString(int nDec,
                                                      int sepStyle)
Get a AFPercent_Format string

Parameters:
nDec - The number of places after the decimal point
sepStyle - The integer denoting whether to use a separator or not. If sepStyle=0, use commas. If sepStyle=1, do not separate

getPercentKeystrokeString

public static java.lang.String getPercentKeystrokeString(int nDec,
                                                         int sepStyle)
Get a AFPercent_Keystroke string

Parameters:
nDec - The number of places after the decimal point
sepStyle - The integer denoting whether to use a separator or not. If sepStyle=0, use commas. If sepStyle=1, do not separate

getDateFormatString

public static java.lang.String getDateFormatString(java.lang.String cFormat)
Get a AFDate_FormatEx string

Parameters:
cFormat - Must be one of: "m/d", "m/d/yy", "mm/dd/yy", "mm/yy", "d-mmm", "d-mmm-yy", "dd-mmm-yy", "yymm-dd", "mmm-yy", "mmmm-yy", "mmm d, yyyy", "mmmm d, yyyy", "m/d/yy h:MM tt", "m/d/yy HH:MM"

getDateKeystrokeString

public static java.lang.String getDateKeystrokeString(java.lang.String cFormat)
Get a AFDate_KeystrokeEx string

Parameters:
cFormat - Must be one of: "m/d", "m/d/yy", "mm/dd/yy", "mm/yy", "d-mmm", "d-mmm-yy", "dd-mmm-yy", "yymm-dd", "mmm-yy", "mmmm-yy", "mmm d, yyyy", "mmmm d, yyyy", "m/d/yy h:MM tt", "m/d/yy HH:MM"

getTimeFormatString

public static java.lang.String getTimeFormatString(int ptf)
Get a AFTime_Format string

Parameters:
ptf - The time format: 0 = 24HR_MM [ 14:30 ], 1 = 12HR_MM [ 2:30 PM ], 2 = 24HR_MM_SS [ 14:30:15 ], 3 = 12HR_MM_SS [ 2:30:15 PM ]

getTimeKeystrokeString

public static java.lang.String getTimeKeystrokeString(int ptf)
Get a AFTime_Keystroke string

Parameters:
ptf - The time format: 0 = 24HR_MM [ 14:30 ], 1 = 12HR_MM [ 2:30 PM ], 2 = 24HR_MM_SS [ 14:30:15 ], 3 = 12HR_MM_SS [ 2:30:15 PM ]

getSpecialFormatString

public static java.lang.String getSpecialFormatString(int psf)
Get a AFSpecial_Format string

Parameters:
psf - The type of formatting to use:0 = zip code, 1 = zip + 4, 2 = phone, 3 = SSN

getSpecialKeystrokeString

public static java.lang.String getSpecialKeystrokeString(int psf)
Get a AFSpecial_Format string

Parameters:
psf - The type of formatting to use:0 = zip code, 1 = zip + 4, 2 = phone, 3 = SSN

getSimpleCalculateString

public static java.lang.String getSimpleCalculateString(java.lang.String cFunction,
                                                        java.lang.String... cFields)
Get a AFSimple_Calculate string

Parameters:
cFunction - Must be one of "AVG", "SUM", "PRD", "MIN", "MAX"
cFields - The name list of the fields to use in the calculation