visit Kofax web site

helpers.php File Reference


Detailed Description

SignWare Dynamic Development toolkit.

Author:
uko
Helper functions to access SignWare from a PHP environment

Traces


Enumerations

enum  DUMP_OPTIONSSTRING
 Set this define to TRUE to dump the options string in a separate browser window (for debugging / demonstration purposes). More...

Functions

 asciiHexToInt ($aStr)
 convert an ASCII-HEX string to a number
 checkPHP ()
 Check the PHP environment.
 dumpFile ($aName, $aData, $iLen=0)
 Write some data into a file.
 getParam ($aName)
 Query a POST or GET parameter.
 loadFile ($aName)
 Read a file.
 makeAbsFile ($relFile)
 Make an absolute file name to the provided relative link location.
 makeLink ($relAdr)
 Make a link to the provided relative link location.
 popupParamString ($aString)
 popupWindow ($aPage)
 sessionSetTabletInfo ()
 Save data that was returned from a PadInfo query in the session.
 setSessionIntfromHexString ($aName, $aValue)
 setSessionString ($aName, $aValue)
 trace ($iLvl, $msg)
 Trace a message into the containers logfile.

Variables

 $hasOptionsScript = FALSE
 $iTraceLevel = 5
 Global TraceLevel, range 0 ... 5, 0 logs nothing, 5 logs most.


Enumeration Type Documentation

enum DUMP_OPTIONSSTRING
 

Set this define to TRUE to dump the options string in a separate browser window (for debugging / demonstration purposes).


Function Documentation

asciiHexToInt aStr  ) 
 

convert an ASCII-HEX string to a number

Parameters:
$aStr [i] the string
Returns:
integer the number
Note:
PHP cannot convert negative 8 digit hex numbers due to internal limitations. This method converts 8 digit negative HEX numbers correctly

checkPHP  ) 
 

Check the PHP environment.

Returns:
String, empty string if all required extensions are loaded, else a list of missing modules

dumpFile aName,
aData,
iLen = 0
 

Write some data into a file.

Parameters:
$aName [i] name of the file to write, must be a fully qualified filename (incl. path)
$aData [i] the data to write
$iLen [i] the length of the data buffer, may be 0 (strlen($aData) will be used

getParam aName  ) 
 

Query a POST or GET parameter.

Parameters:
$aName [i] name of the parameter
Returns:
String the value, or "" if it is not set

loadFile aName  ) 
 

Read a file.

Parameters:
$aName [i] name of the file to read, must be a fully qualified filename (incl. path)
Returns:
String the data read

makeAbsFile relFile  ) 
 

Make an absolute file name to the provided relative link location.

Parameters:
$relFile [i] relative link location
Returns:
String the FQN (fully qualified filename)
Note:
assuming the server files are located in "C:\signware\b_api\samples\php" and $relAdr is "tmp/tmpFile.bmp" then makeLink returns "C:\signware\b_api\samples\php\tmp\tmpFile.bmp"

The server address is read from the global PHP variable $_SERVER["SCRIPT_FILENAME"], the link is thus relative to the current SCRIPT_FILENAME page.

makeLink relAdr  ) 
 

Make a link to the provided relative link location.

Parameters:
$relAdr [i] relative link location
Returns:
String the link location
Note:
This function uses SERVER_PROTOCOL and HTTP_HOST to create the absolute address. It may fail for ome virtual host configurations

popupParamString aString  ) 
 

Popup a new browser window to display the contents of the options string

popupWindow aPage  ) 
 

sessionSetTabletInfo  ) 
 

Save data that was returned from a PadInfo query in the session.

The session variable "pad_Device" will be set to 0 (no device) or a valid device id The session variable "pad_Width" will be set if a device was detected The session variable "pad_Height" will be set if a device was detected The session variable "pad_LcdBpP" will be set if a device with lcd screen was detected The session variable "pad_LcdWidth" will be set if a device with lcd screen was detected The session variable "pad_LcdHeight" will be set if a device with lcd screen was detected

setSessionIntfromHexString aName,
aValue
 

private helper function to convert a hex string to an numeric value and save the result in the session

setSessionString aName,
aValue
 

private helper function save a string in the session

trace iLvl,
msg
 

Trace a message into the containers logfile.

Parameters:
$iLvl [i] trace level, range 1 .. 5
$msg [i] String message, the text to write
Note:
trace will write the message to the default PHP logging feature


Variable Documentation

$hasOptionsScript = FALSE
 

$iTraceLevel = 5
 

Global TraceLevel, range 0 ... 5, 0 logs nothing, 5 logs most.