Overview

Namespaces

  • Neodynamic
    • SDK
      • Web
  • PHP

Classes

  • ClientPrinter
  • ClientPrintJob
  • ClientPrintJobGroup
  • DefaultPrinter
  • InstalledPrinter
  • NetworkPrinter
  • ParallelPortPrinter
  • PrintFile
  • SerialPortHandshake
  • SerialPortParity
  • SerialPortPrinter
  • SerialPortStopBits
  • UserSelectedPrinter
  • Utils
  • WebClientPrint
  • Overview
  • Namespace
  • Class
  • Tree

Class WebClientPrint

WebClientPrint provides functions for registering the "WebClientPrint for PHP" solution script code in PHP web pages as well as for processing client requests and managing the internal cache.

Namespace: Neodynamic\SDK\Web
Copyright: (c) 2016, Neodynamic SRL
License: Neodynamic EULA
Author: Neodynamic <http://neodynamic.com/support>
Located at WebClientPrint.php
Methods summary
public static
# cacheAdd( string $sid, string $key, string $val )

Adds a new entry to the built-in file system cache.

Adds a new entry to the built-in file system cache.

Parameters

$sid
string
$sid The user's session id
$key
string
$key The cache entry key
$val
string
$val The data value to put in the cache

Throws

Exception
public static string
# cacheGet( string $sid, string $key )

Gets a value from the built-in file system cache based on the specified sid & key

Gets a value from the built-in file system cache based on the specified sid & key

Parameters

$sid
string
$sid The user's session id
$key
string
$key The cache entry key

Returns

string
Returns the value from the cache for the specified sid & key if it's found; or an empty string otherwise.

Throws

Exception
public static
# cacheClean( integer $minutes )

Cleans the built-in file system cache

Cleans the built-in file system cache

Parameters

$minutes
integer
$minutes The number of minutes after any files on the cache will be removed.
public static string
# createWcppDetectionScript( string $webClientPrintControllerAbsoluteUrl, string $sessionID )

Returns script code for detecting whether WCPP is installed at the client machine.

Returns script code for detecting whether WCPP is installed at the client machine.

The WCPP-detection script code ends with a 'success' or 'failure' status. You can handle both situation by creating two javascript functions which names must be wcppDetectOnSuccess() and wcppDetectOnFailure(). These two functions will be automatically invoked by the WCPP-detection script code.

The WCPP-detection script uses a delay time variable which by default is 10000 ms (10 sec). You can change it by creating a javascript global variable which name must be wcppPingDelay_ms. For example, to use 5 sec instead of 10, you should add this to your script:

var wcppPingDelay_ms = 5000;

Parameters

$webClientPrintControllerAbsoluteUrl
string
$webClientPrintControllerAbsoluteUrl The Absolute URL to the WebClientPrintController file.
$sessionID
string
$sessionID The current Session ID.

Returns

string
A [script] tag linking to the WCPP-detection script code.

Throws

Exception
public static string
# createScript( string $webClientPrintControllerAbsoluteUrl, string $clientPrintJobAbsoluteUrl, mixed $sessionID )

Returns a [script] tag linking to the WebClientPrint script code by using the specified URL for the client print job generation.

Returns a [script] tag linking to the WebClientPrint script code by using the specified URL for the client print job generation.

Parameters

$webClientPrintControllerAbsoluteUrl
string
$webClientPrintControllerAbsoluteUrl The Absolute URL to the WebClientPrintController file.
$clientPrintJobAbsoluteUrl
string
$clientPrintJobAbsoluteUrl The Absolute URL to the PHP file that creates ClientPrintJob objects.
$sessionID

Returns

string
A [script] tag linking to the WebClientPrint script code by using the specified URL for the client print job generation.

Throws

Exception

Paran

string $sessionID The current Session ID.
public static
# generateScript( type $webClientPrintControllerAbsoluteUrl, type $queryString )

Generates the WebClientPrint scripts based on the specified query string. Result is stored in the HTTP Response Content

Generates the WebClientPrint scripts based on the specified query string. Result is stored in the HTTP Response Content

Parameters

$webClientPrintControllerAbsoluteUrl
type
$webClientPrintControllerAbsoluteUrl The Absolute URL to the WebClientPrintController file.
$queryString
type
$queryString The Query String from current HTTP Request.
public static integer
# GetProcessRequestType( string $queryString )

Determines the type of process request based on the Query String value.

Determines the type of process request based on the Query String value.

Parameters

$queryString
string
$queryString The query string of the current request.

Returns

integer
A valid type of process request. In case of an invalid value, an Exception is thrown.

Throws

Exception
Constants summary
string VERSION '3.0.2016.0'
#
string CLIENT_PRINT_JOB 'clientPrint'
#
string WCP 'WEB_CLIENT_PRINT'
#
string WCP_SCRIPT_AXD_GET_PRINTERS 'getPrinters'
#
string WCPP_SET_PRINTERS 'printers'
#
string WCP_SCRIPT_AXD_GET_WCPPVERSION 'getWcppVersion'
#
string WCPP_SET_VERSION 'wcppVer'
#
string GEN_WCP_SCRIPT_URL 'u'
#
string GEN_DETECT_WCPP_SCRIPT 'd'
#
string SID 'sid'
#
string PING 'wcppping'
#
string WCP_CACHE_WCPP_INSTALLED 'WCPP_INSTALLED'
#
string WCP_CACHE_WCPP_VER 'WCPP_VER'
#
string WCP_CACHE_PRINTERS 'PRINTERS'
#
integer GenPrintScript 0
#

Generates printing script.

Generates printing script.

integer GenWcppDetectScript 1
#

Generates WebClientPrint Processor (WCPP) detection script.

Generates WebClientPrint Processor (WCPP) detection script.

integer ClientSetInstalledPrinters 2
#

Sets the installed printers list in the website cache.

Sets the installed printers list in the website cache.

integer ClientGetInstalledPrinters 3
#

Gets the installed printers list from the website cache.

Gets the installed printers list from the website cache.

integer ClientSetWcppVersion 4
#

Sets the WebClientPrint Processor (WCPP) Version in the website cache.

Sets the WebClientPrint Processor (WCPP) Version in the website cache.

integer ClientGetWcppVersion 5
#

Gets the WebClientPrint Processor (WCPP) Version from the website cache.

Gets the WebClientPrint Processor (WCPP) Version from the website cache.

Properties summary
public static string $licenseOwner ''
#

Gets or sets the License Owner

Gets or sets the License Owner

public static string $licenseKey ''
#

Gets or sets the License Key

Gets or sets the License Key

public static string $webClientPrintAbsoluteUrl ''
#

Gets or sets the ABSOLUTE URL to WebClientPrint.php file

Gets or sets the ABSOLUTE URL to WebClientPrint.php file

public static string $wcpCacheFolder ''
#

Gets or sets the wcpcache folder URL RELATIVE to WebClientPrint.php file. FILE WRITE permission on this folder is required!!!

Gets or sets the wcpcache folder URL RELATIVE to WebClientPrint.php file. FILE WRITE permission on this folder is required!!!

WebClientPrintPHP API documentation generated by ApiGen 2.8.0