Kofax Capture plugin
SOFTPRO Capture plugin
Plugin Version 2.1.10.0ActiveX Version 2.1.10.0
ActiveX CLSID {FF6EC0EB-F5A9-436c-A64C-F63791FCC157}
COM plugin: ActiveCap.cab.
Nescape plugin: SpCapPlugin.jar, SpCapPlugin.xpi, NpSpCap32.dll.
The SOFTPRO Capture plugin implements these functions
- Function 'query plugin version'
- Function 'query tablet type' (query tablet type and tablet data)
- Function 'acquire signature or reference' (acquire signature or reference)
- Function 'Scanner' (capture a scanned image)
Function 'query plugin version'
Query the plugin version.Parameters:
- width: the width of the visible plugin window, may be 0, Integer parameter
- height: the height of the visible plugin window, may be 0, Integer parameter
- function: the function, must be "Version", String parameter
- sendTo: the servlet to pass the version, String parameter
- target: specify the result target window, String parameter
- lang: specify the language, String parameter
- str: response stream type, String parameter
Return values:
- rc: the final result, Integer return, Standard return values
- version: a string to return the four digit version, String return
version="\"SOFTPRO Capture Plugin V VERSION_MAJOR.VERSION_MINOR.VERSION_REVISION.VERSION_BUILD\"" example version="\"SOFTPRO Capture Plugin V 2.0.0.0\"" - iv: the version as a number, Integer return
iv=MMmmrrbb, where MM is 8 bit MAJOR, mm is 8-bit MINOR, rr is 8-bit REVISION and bb is 8-bit BUILD version.
Function 'query tablet type'
Query the connected tablet model and some characteristics of the tablet.The plugin cabinet files include modules to access the manufacturers drivers of tablet. You must install the SOFTPRO interfaces when not using Internet Explorer.
You must install the manufacturers drivers when connecting the tablet, except for TabletPC's. TabletPCs are supported without additional modules.
Parameters:
- width: the width of the visible plugin window, may be 0, Integer parameter
- height: the height of the visible plugin window, may be 0, Integer parameter
- function: the function, must be "QueryPad", String parameter
- sendTo: the servlet to pass tablet data, String parameter
- target: specify the result target window, String parameter
- lang: specify the language, String parameter
- str: response stream type, String parameter
- padalias: alias name of the tablet, optional, String parameter
- padclass: the tablet class, may be a semicolon separated list of class if padconfiguration is empty, optional, see Tablet creation parameters, String parameter
- padconfiguration: the tablet configuration string, optional, see Tablet creation parameters, base 64 encoded string, Base64-encoded data
- auth: a valid license ticket, optional, see License restrictions, base 64 encoded string, Base64-encoded data
- rc: the final result, Integer return, Standard return values
- driver: the driver number, Integer return
- device: the device identifier, Integer return
- samplerate: the sample rate of the tablet, Integer return
- maxpress: maximum pressiore level of the tablet, Integer return
- resolution: Resolution of the tablet, typically 300 DPI, Integer return
- height: height of the tablet [in pixel], Integer return
- width: width of the tablet [in pixel], Integer return
- lcdwidth: width of the lcd screen [in pixel], only for devices with external LCD, Integer return
- lcdheight: height of the lcd screen [in pixel], only for devices with external LCD, Integer return
- serialno: optional, serial number of the device, only if the tablet returns a valid serial number , Base64-encoded String return
- hwfilename: optional, the base64 encoded name of the associated hardware handle, only if the tablet returns a valid file name, Base64-encoded String return
- padclass: the classname of the pad, since Version 2.1.2.0, String return
- padconfiguration: configuration options for the pad, since Version 2.1.2.0, Base64-encoded String return
- pluginversion: the version of the plugin, e. g. 2.1.2.0, since Version 2.1.2.0, String return
- Note:
- This function is license restricted in SOFTPRO SignDoc and SOFTPRO Capture plugins. You must either install a 'BrowserPlugin' License or pass a valid 'Auth' Parameter, License restrictions.
Internet Explorer: You must turn off 'Protected Mode' if you do not use the Auth mechanism.
Function 'acquire signature or reference'
Capture a signature or reference on the client and return the captured signature incl. all biometric features.The plugin may also show a document on ta tablet screen, capture signatures for the signature fields in the document, see Document view / sign for more information.
The plugin cabinet files include modules to access the manufacturers drivers of tablet. You must install the SOFTPRO interfaces when not using Internet Explorer.
You must install the manufacturers drivers when connecting the tablet, except for TabletPC's. TabletPCs are supported without additional modules. For details on tablet configuration please see Pad installation and configuration.
Parameters:
- width: the width of the visible plugin window, Integer parameter
- height: the height of the visible plugin window, Integer parameter
- function: the function, must be "Tablet", String parameter
- sendTo: the servlet to pass tablet data, String parameter
- target: specify the result target window, String parameter
- lang: specify the language, String parameter
- str: response stream type, String parameter
- ts: timestamp, optional, Integer parameter
- BgCol: background color, 0x00RRGGBB, Integer parameter
- FgCol: foreground color, 0x00RRGGBB, Integer parameter
- PadEntryOptions: XML description of the signature entry dialog, see Optional Signature entry parameters, base64 encoded string, Base64-encoded data
- padalias: the alias name of the desired tablet, optional, see Tablet creation parameters, String parameter
- padclass: the tablet class, optional, see Tablet creation parameters, String parameter
- padconfiguration: the tablet configuration string, optional, see Tablet creation parameters, base 64 encoded string, Base64-encoded data
- auth: a valid license ticket, optional, base 64 encoded string, see License restrictions, Base64-encoded data
- rc: the final result, Integer return, Standard return values
- sign: the acquired signature data, binary array containing a SOFTPRO dynamic signature, Binary data return
- sign_order: the order of the signatures in the returned reference-array, if more than 1 optional signature fields are included in the dialog, then the sign_order assigns each returned signature to the zero based dialog index. the value is a semicolon separated list, String return
- encoding: only if successfull, String return.
The encoding of the signature is a string which contains these parts:- Compression:
- 'Base64': sign is Base64 encoded
- 'Base64Url': sign is Base64-URL encoded
- 'NibbleHex': sign is NibbleHex encoded
- Encryption:
- 'SPEncrypt': an external extension was loaded to encrypt the signature
The parameter sign will be filled using the specified encoding, defaults to 'NibbleHex'. Encryption may be appended to the compression. - Compression:
- img: the acquired signatures as images, binary array containing signature images in a zip-file container, Binary data return
- img_order: the order of the images in the returned image container, if more than 1 optional signature fields are included in the dialog, then the img_order assigns each returned image to the zero based dialog index. the value is a semicolon separated list, String return
- img_encoding: only if successfull, String return.
The encoding of the signature is a string which contains these parts:- Compression:
- 'Base64Zip': sign is a Base64 encoded zip compressed
- 'Base64UrlZip': sign is a Base64-URL encoded zip compressed
- Encryption:
- 'SPEncrypt': an external extension was loaded to encrypt the image container
The parameter img will be filled using the specified encoding, defaults to 'Base64Zip'. Encryption may be appended to the compression. - Compression:
- further parameters depending on PadEntryOptions, see Optional Signature entry parameters
- pluginversion: the version of the plugin, e. g. 2.1.2.0, since Version 2.1.2.0, String return
- Note:
- The plugin will display three buttons in the signature entry dialog for "OK", "Cancel" and "Erase", if no PadEntryOptions are specified.
The parameters 'sign', 'sign_order', 'encoding' may be omitted if the PadOptions specify 'ResultFormat' 'None'.
The parameters 'img', 'img_order' and 'img_encoding' may be omitted if the PadOptions specify 'ResultImageFormat' 'None'.This function is license restricted in SOFTPRO SignDoc and SOFTPRO Capture plugins. You must either install a 'BrowserPlugin' License or pass a valid 'Auth' Parameter, License restrictions.
Internet Explorer: You must turn off 'Protected Mode' if you do not use the Auth mechanism.
Optional Signature entry parameters
The signature entry dialog may be customized with images, text, text fields and buttons. The elements are displayed on the PC screen and / or on the tablet LCD screen. All optional fields must be defined in a XML descriptor, which is passed to the signature entry dialog in the parameter 'PadEntryOptions'.These visible objects must be layed out:
- Plugin Window (defined by width and height in the object / embed tag)
- Entry window (the tablet inking region on the screen, defined by the PlCoordinate element passed to PlEntryOptions
- PlButtons (a number of buttons placed in the Plugin Window or the Entry window, each button is located by its associated PlCoordinate
- PlText (a number of static text fields placed in the Plugin Window or the Entry window, each field is located by its associated PlCoordinate
- PlTextEntry (a number of text entry fields placed in the Plugin Window or the Entry window, each field is located by its associated PlCoordinate
- PlImage (an image that may be drawn on the Tablet LCD (if applicable, flags value 4 must be set) and / or in the Entry window (flags value 8 must be set). The image will be resized to cover the full destination region. It is recommended to pass an image with the correct size for the attached tablet LCD screen. Image resizing will always be lossy.
- PlDocument a document is similar to a PlImage, but the document view adds capabilities to zoom and scroll the image, and to sign some fields on the document.
A set of flags define the behaviour of PlButton / PlText and PlTextEntry objects (not all flagas are supported for all objects)
- 1 The object is drawn in the Browser window as a native object
- native buttons are always clickable with the mouse
- native entry fields capture text when focussed
- 2 The object is drawn in the entry window, no native object is created to draw this object. Virtual objects must be made clickable, else they produce no events.
- virtual objects are not clickable per se.
- 4 Draw the object on the image which will be sent to the LCD screen of the tablet, no native object is created to draw this object. Virtual objects must be made clickable, else they produce no events. Virtual objects are not clickable per se.
- 8 Draw the object on the image which will be sent to the entry window of the tablet, no native object is created to draw this object. Virtual objects must be made clickable, else they produce no events. Virtual objects are not clickable per se.
- 0x100 Make the object clickable with the pen of the tablet. This enables actions on virtual buttons with the tablet pen.
- 0x200 Make the object clickable with the mouse. This enables actions on virtual buttons with the mouse.
Limitations
Not all Fonts may be installed on the client side. The plugin will try to find the closest font possible to match the requested font face and font size, however the developer should assure that the font is available locally on the client PC.Keyboard navigation (Ctrl TAB, Ctrl Shift TAB) is not supported.
Euro - symbol does not display correctly in PlTextEntry fields
Document Type Definition for PadEntryOptions and ScannerEntryOptions
<!-- DTD for Parameter PadEntryOptions in SOFTPRO plugins Module: PadEntryOptions.dtd Created by: uko Copyright SOFTPRO GmbH Wilhelmstrasse 34, D-71034 Böblingen All rights reserved. This software is the confidential and proprietary information of SOFTPRO ("Confidential Information"). You shall not disclose such Confidential Information and shall use it only in accordance with the terms of the license agreement you entered into with SOFTPRO. --> <!ELEMENT ScannerEntryOptions (ScannerDialog+, ScannerMessage*, ServiceAccess?, ScannerClass*)> <!ATTLIST ScannerEntryOptions ScannerClass (ScannerTwain | ScannerWia | ScannerWia2 | ScannerDirectShow | ScannerSane) #IMPLIED ScannerId CDATA #IMPLIED ResultImage (Bmp | Png | Gif | Tiff | Jpeg | None) #REQUIRED ResultEncoding (Base64Raw | Base64Zip | Base64UrlZip | Base64UrlRaw ) #REQUIRED > <!-- Elements ScannerDialog one or more Dialogs that will be called successively ScannerMessage Text strings for error or warning popups ServiceAccess zero or one object to access the clean service ScannerClass zero or more ScannerClass elements, the attributes ScannerClass and ScannerId will be ignored if ScannerClass elements are specified Attributes ScannerClass deprecated, use element ScannerClass instead ScannerId deprecated, use element ScannerClass instead ResultImage The image format of the scanned images, ImageNone will return Gray images in Gif and color images in Jpeg Format, you may overrule the göobal image format via the ScannerSetting object ResultEncoding Encoding of the result images: - Base64Zip pack all images into a zip file and return the base64 encoded zip file in request parameter images= - Base64Raw return all images base64-encoded in request parameters Image0= ... Imagen= - Base64UrlRaw return all images base64-URL-safe-encoded (rfc3548) in request parameters Image0= ... Imagen= - Base64UrlZip pack all images into a zip file and return the base64-URL-safe encoded (rfc3548) zip file in request parameter images= Note: ScannerSane is not implemented, ScannerWia2 is not yet implemented --> <!ELEMENT ScannerClass EMPTY> <!ATTLIST ScannerClass Class (ScannerTwain | ScannerWia | ScannerWia2 | ScannerDirectShow | ScannerSane) #IMPLIED Name CDATA #IMPLIED > <!-- Attributes Class Class name of Scanner drivers, the Scanner list will be limited to the devices found in the specified class, all classes are include if the parameter is omitted Name Name of the device as a regular expression Note: The devices that may be offered to the user must match the ScannerName. You may leave ScannerName empty to use all devices for the according ScannerClass. ScannerSane is not implemented, ScannerWia2 is not yet implemented --> <!ELEMENT ScannerMessage (#PCDATA)*> <!ATTLIST ScannerMessage Id (DeviceBusy | DeviceOffline | DeviceParameterUnsupported | DeviceNotSelected | ScanImagesMissing | CannotReadFile | InternalError) #REQUIRED > <!-- Elements PCDATA the message string, utf-8 encoded Attributes Id the message identifier --> <!ELEMENT ServiceAccess EMPTY> <!ATTLIST ServiceAccess Url CDATA #REQUIRED User CDATA #IMPLIED Password CDATA #IMPLIED Timeout CDATA #IMPLIED ProxyHost CDATA #IMPLIED ProxyPort CDATA #IMPLIED ProxyUser CDATA #IMPLIED ProxyPassword CDATA #IMPLIED > <!-- Attributes Url the url of the service User optional user name if HTTP Authentication is required Password optional password if HTTP Authentication is required Timeout optional timeout in seconds ProxyHost optional host name of proxy ProxyPort optional port of proxy ProxyUser optional user name for proxy authentication if required ProxyPassword optional password for proxy authentication if required --> <!ELEMENT ScannerDialog (PlCoordinate, ScannerWindow?, ScannerSetting*, PlText*, PlRectangle*)> <!ATTLIST ScannerDialog Class (ScannerCapture | ScannerSettings | ScannerSelectSource) #REQUIRED BgColor CDATA #IMPLIED FgColor CDATA #IMPLIED AllowCrop (true | false | left | none | right) #IMPLIED > <!-- Elements PlCoordinate the size of the Scannerentry window within the plugin window, Origin must be Entry ScannerWindow one or more windows ScannerSetting zero or more ScannerSetting objects PlText zero or more Text elements PlRectangle zero or more Rectangle elements Attributes: Class the dialog class name BgColor Background color, 0x00rrggbb, pass 0xffffffff to define transparent window color FgColor Foreground color, 0x00rrggbb, pass 0xffffffff to define transparent window color, AllowCrop left or true: default mouse action is crop image (preset) with left mouse button drag, move image with right mouse button drag, none or false: default mouse action is move image with left mouse button drag, no action with right mouse button drag right: default mouse action is crop image (preset) with right mouse button drag, move image with left mouse button drag, Note: the mouse button drag operations will be overruled by ssome actions (e.g. PlAction::ImageCropAction or PlAction::ImageEditAction) --> <!ELEMENT ScannerSetting EMPTY> <!ATTLIST ScannerSetting PropertyId CDATA #REQUIRED Value CDATA #REQUIRED Required (true | false) #IMPLIED > <!-- Attributes PropertyId the identifyer or the numeric value of the property - DeviceName, 1, string, read only - DeviceDescription, 2, string, read only - DriverClassName, 3, string, read only, use ScannerEntryOptions, Attribute ScannerClass - DriverName, 4, string, read only - VendorName, 5, string, read only - FirmwareVersion, 6, string, read only - DeviceId, 7, string, read only, use ScannerEntryOptions, Attribute ScannerId - DeviceType, 8, enum DeviceType, read only - Papersize, 9, enum Papersize, pass by the numeric enum value or by name (e.g. "A4") - Width, 10, int, width in mm (pixel for cameras) - OffsetX, 11, int left corner in mm (pixel for cameras) - Height, 12, int, height in mm (pixel for cameras) - OffsetY, 13, int, top corner in mm (pixel for cameras) - ResolutionX, 14, int, resolution DPI - ResolutionY, 15, int, resolution DPI - ImageFormat, 16, enum ImageFormat, pass by the numeric enum value or by name (e.g. "Bmp") - BitsPerPixel, 17, int 1 or 8 or 24 - Threshold, 18, int, range 0 ... 255 - Contrast, 19, int, range 0 ... 1000 - Brightness, 20, int, range 0 ... 1000 - LightSource, 21, enum LightSource, pass by the numeric enum value or by name (e.g. "Red") - ThumbWidth, 22, int, width in pixel, only for camera preview - ThumbHeight, 23, int, height in pixel, only for camera preview - CaptureAsynchronous, 24, bool, unsupported - CanReacquire, 25, bool, read only - HasDuplex, 26, bool, read only - CanUserGui, 27, bool read only - Gain, 29, int, range 0 ... 1000 - ForceImageSize, 32, bool, DirectSho resize the captured image if the size is larger than specified enum Papersize: - Custom, 1 - A0, 2 - A1, 3 - A2, 4 - A3, 5 - A4, 6 - A5, 7 - A6, 8 - A7, 9 - A8, 10 - B2, 11 - B3, 12 - B4, 13 - B5, 14 - B6, 15 - C3, 16 - C4, 17 - C5, 18 - C6 19 enum DeviceType - Default, 1 - Scanner, 2 - Camera, 3 - Video 4 enum LightSource - Default 1 - Red, 2 - Green, 3 - Blue, 4 - None, 5 - White, 6 - UV, 7 - IR, 8 enum Image Format - None 1 - Bmp, 2 - Tiff, 3 - Jpeg, 4 - Png, 5 - Gif 6 Value the value of the property Required optional: the property is required, it is an error if the scanner does not support the setting, currently not supported, no property is required --> <!ELEMENT ScannerWindow (#PCDATA | PlCoordinate | PlText | PlTextEntry | PlButton | PlSlider | PlComboBox | PlRectangle | PlImage )*> <!ATTLIST ScannerWindow Class (ImageWindow | ToolWindow|VideoWindow) #REQUIRED BgColor CDATA #IMPLIED FgColor CDATA #IMPLIED Encoding (base64 | base64compressed) #IMPLIED > <!-- Elements PlCoordinate one PlCoordinate, the size of the window within the plugin dialog, Origin must be Entry, which refers to the Dialog window PlText zero or more static text fields, only valid in class ToolWindow PlTextEntry zero or more text entry fields, only valid in class ToolWindow PlButton zero or more buttons, only valid in class ToolWindow PlSlider zero or more sliders, only valid in class ToolWindow PlComboBox zero or more combo boxes, only valid in class ToolWindow PlRectangle zero or more Rectangle elements, only valid in class ToolWindow PlImage zero or more Image elements, only valid in class ToolWindow #PCDATA optional Image data, only valid in class ImageWindow Attributes Class Class name of the object, ImageWindow, ToolWindow or VideoWindow. A ImageWindow displays a scanned image, a ToolWindow is the container for tools, a VideoWindow displays the live stream of a video camera BgColor Background color, 0x00rrggbb, pass 0xffffffff to define transparent window color FgColor Foreground color, 0x00rrggbb, pass 0xffffffff to define transparent window color, Encoding optional Image data format, required if an image is passed Note: all coordinates must reference the origin plugin or entry, plugin refers to the dialog size, entry refers to the size of this ScannerWindow object --> <!ELEMENT PadEntryOptions (PadEntryDialog*)> <!ATTLIST PadEntryOptions EncryptModule CDATA #IMPLIED EncryptParameter CDATA #IMPLIED PadSerialType (Default | Custom | Factory) "Default" ResultEncoding (Base64 | Base64Url | NibbleHex | Base64SPEncrypt | Base64UrlSPEncrypt | NibbleHexSPEncrypt ) "NibbleHex" ResultFormat ( None | SP_SOFTPRO | ISO_19794) "SP_SOFTPRO" ResultImageEncoding (Base64Zip | Base64UrlZip | Base64ZipEncrypt | Base64UrlZipEncrypt ) "Base64Zip" ResultImageFormat ( None | Bmp | Png | Gif | Tiff) "None" > <!-- Elements PadEntryDialog one or more Dialogs that will be called successively Attributes EncryptModule the name of the optional encryption module. Note: it is an error if the specified module cannot be loaded EncryptParameter Optional parameters for the encryption module. PadSerialType type of device serial number to embed in the signature - Default custom-set ID if set, factory-set ID otherwise - Custom custom-set ID - Factory factory-set ID ResultEncoding Encoding of the final result signature(s) ResultFormat the format of the resulting signatures. - None don't return dynamic signature data - SP_SOFTPRO use the proprietary SOFTPRO signature format, which embeds multiple signatures in a single flatfile structure - ISO_19794 serialize the captured signatures in a CBEFF format according to ISO 19785-3 ResultImageEncoding Encoding of the final result signature images ResultImageFormat the format of the resulting signature images. - None don't return signature images - Bmp convert the captured signatures to Bmp-images and return the image - Png convert the captured signatures to Png-images and return the image - Gif convert the captured signatures to Gif-images and return the image - Tiff convert the captured signatures to Tiff-images and return the image Note: The parser in the browser plugins (ActiveTC, NSSPRo32) is compatible with older versions of this dtd, that means <PadEntryOptions (PlCoordinate, PlText*, PlTextEntry*, PlImage?, PlButton*, PlTablet?) /> will be interpreted as: <PadEntryOptions (PadEntryDialog (PlCoordinate, PlText*, PlTextEntry*, PlImage?, PlButton*, PlTablet?) /) /> A mix of both versions will produce undefined results. --> <!ELEMENT PadEntryDialog (PlCoordinate, PlTablet?, (PlText | PlTextEntry | PlImage | PlDocument | PlButton | PlRectangle)* )> <!ATTLIST PadEntryDialog BgColor CDATA #IMPLIED FgColor CDATA #IMPLIED Mandatory (True|False) #IMPLIED > <!-- Elements PlCoordinate the size of the Pad entry window within the plugin window PlText zero or more static text fields PlTextEntry zero or more text entry fields PlImage zero or more background images PlDocument zero or more background documents PlButton zero or more buttons PlRectangle zero or more rectangles PlTablet zero or one tablet descriptor Attributes BgColor Background color, 0x00rrggbb, pass 0xffffffff to define transparent window color default white FgColor Foreground color, 0x00rrggbb, use foreground color to draw tablet strokes default black Mandatory The captured signature in this dialog is required if true, default: true Note: the attribute PlTablet Flags (value 0x10, turn off stroke echo) has presedence. If PlTablet Flags value 0x10 is set then Mandatory is ignored. --> <!ELEMENT PlCoordinate EMPTY > <!ATTLIST PlCoordinate Origin (Plugin | Entry | Document) #REQUIRED Left CDATA #REQUIRED Top CDATA #REQUIRED Right CDATA #REQUIRED Bottom CDATA #REQUIRED > <!-- Attributes: Origin Origin may be one of the following: - Plugin all coordinates are relative to the top left corner of the plugin window, (0, 0 , 1000, 1000) cover the entire Plugin window - Entry all coordinates are relative to the top left corner of the entry window, (0, 0 , 1000, 1000) cover the entire draw window - Document all coordinates are relative to the top left corner of the parent document (0, 0 , 1000, 1000) cover the entire document Left the left position within the origin window Top the top position within the origin window Right the right position within the origin window Bottom the bottom position within the origin window --> <!ELEMENT PlAction EMPTY > <!ATTLIST PlAction Name CDATA #IMPLIED Id (OKAction | CancelAction | EraseAction | SendToAction | NextAction | ToggleAction | PrevAction | GoPageAction | ScannerSelectAction | ScannerPapersizeAction | ScannerThresholdAction | ScannerBrightnessAction | ScannerContrastAction | ScannerBitdepthAction | ScannerResolutionAction | ScannerTopAction | ScannerLeftAction | ScannerWidthAction | ScannerHeightAction | ScannerLightsourceAction | ScanImageAction | ScanSettingsAction | ImageInvertAction | ImageMirrorAction | ImageRotateAction | ImageUndoAction | ImageEditAction | ImageCropAction | ImagePensizeAction | ImageZoomAction | ImageCleanRectAction | ImageCleanWeightAction | ImageWhitenBackground | ImageCleanLinesAction | FileOpenAction | FormFieldAction | SignAction) #REQUIRED strValue CDATA #IMPLIED iValue CDATA #IMPLIED LastSaved (true | false) #IMPLIED > <!-- Attributes: Name the Name of the ToggleAction, the value will be returned as parameter Name=value Id Action identifier may be one of the following: - OKAction OK button, pass the signature to the servlet - CancelAction Cancel button - EraseAction Erase button - NextAction Next page button - PrevAction Previous page button - GoPageAction Show page (value) button, iValue is the page number to display - ToggleAction Toggle button, behaves like a checkbox, the default value may be passed as iValue, the name of the checkbox must be supplied as Name - SendToAction call the specified servlet (no signature is passed) requires attribute URL, overwrites SendTo = "strValue" - ScannerSelectAction Select the desired Scanner, strValue is filled with the selected scanner identifier, if ScannerSelectAction is assigned to a PlComboBox then the combo items will be read from the available scanners on the client. Evauate LastSave. - ScannerPapersizeAction Select a Papersize, iValue contains the enum representation of the papersize. Evauate LastSave. - ScannerThresholdAction Set a Threshold, iValue contains the (initial) Threshold, range 0 ... 255 Evauate LastSave. - ScannerBrightnessAction Set a Brightness, iValue contains the (initial) Brightness, range 0 .. 1000 Evauate LastSave. - ScannerContrastAction Set a Contrast, iValue contains the (initial) Contrast, range 0 ... 1000 Evauate LastSave. - ScannerBitdepthAction Set a Bitdepth, iValue contains the (initial) Bitdepth Evauate LastSave. - ScannerResolutionAction Set a Resolution, iValue contains the (initial) Resolution [DPI] Evauate LastSave. - ScannerLeftAction Set the left corner of a scan capture, iValue contains the (initial) left coordinate [mm] Evauate LastSave. - ScannerTopAction Set the top corner of a scan capture, iValue contains the (initial) top coordinate [mm] Evauate LastSave. - ScannerWidthAction Set the width of a scan capture, iValue contains the (initial) width [mm] Evauate LastSave. - ScannerHeightAction Set the height of a scan capture, iValue contains the (initial) height [mm] Evauate LastSave. - ScannerLightsourceAction Set the scanner light source, , iValue contains the enum representation of the lightsource Evauate LastSave. - ScanImageAction Scan an Image, iValue is a bitwise or of these values: - 1 show the settings dialog before scanning an image, show the vendor GUI if no settings dialog is defined - 2 show the vendor scan GUI to capture an image - 0x1000 auto clean the background, only for gray images, implicitly calls ImageWhitenBackgroundAction - ScanSettingsAction Display a Settings dialog and scan an image - ImageInvertAction Invert the displayed image - ImageMirrorAction Mirror the displayed image, iValue is a bitwise or of - 1 mirror horizontal - 2 mirror vertical - ImageRotateAction Rotate the displayed image, iValue is the angle in degrees, 90, 180 or 270 - ImageUndoAction Undo the last image processing command - ImageCropAction Select a crop region with the mouse (left button drag), and cut the selected region when releasing the left mouse button. The mouse drag will be ignored if the mouse is release out of the image window The action behaves like a toggle function, it will be turned on and off in successive calls. - ImageEditAction Draw white (right mouse button) or black (left mouse button) over the image using a pen with a diameter defined by ImagePensizeAction, the default pen is 3 (image) pixel wide. The action behaves like a toggle function, it will be turned on and off in successive calls. iValue is a bitwise or of - 1 swap mouse buttons left and right, left mouse button draws white, right mouse button draws black, else the left mouse button draws black and the right mouse button draws white - 2 do not allow to draw black - 4 do not allow to draw white - ImagePensizeAction Set the pen size for drawing in the image, iValue defines the pen diameter in (image) pixel. Evauate LastSave. - ImageZoomAction Image Zoom action will either directly zoom in (iValue == 1) / out (iValue = -1) at the current center position, or use the mouse (iValue = 0) to zoom in / out with left / right mouse click, the center point will be set to the mouse position. The action behaves like a toggle function, it will be turned on and off in successive calls (if iValue = 0). Note: Right / Left double clicks may also zoom in / out, if mouse click events can be ignored (ImageCropAction, mouse clicks do not modify the image). - ImageCleanLinesAction clean horizontal and or vertical lines, iValue passes a bitwise ored value, 1 to clean horizontal and 2 to clean vertical lines - ImageCleanWeightAction Set the weight for the next ImageCleanRectAction, iValue passes the weight, range 0 ... 1000. Evauate LastSave. - ImageCleanRectAction Clean all rectangles with a weight less than the current weight, iValue holds the initial weight, range 0 ... 1000 - ImageWhitenBackgroundAction Set all pixels to white, if the value is larger than 75 % of the mean background level, can be applied to gray images only - FileOpenAction Popup a FileOpen dialog, strValue contains a list of strings that are separated by '|' characters. The first part includes the title, the other strings are couples of file description and file extension mask, e. g. 'Open Read me files|Text files(*.txt;*.me)|*.txt;*.me', - FormFieldAction The according PlTextEdit or PlCombo or PlSlider is a formfield, the result will be returned to the server as Name = strValue pair, requires Name attribute FormFieldAction cannot be combined with lastSaved If a PlText object is assigned FormFieldAction then Attribute strValue must also be set - SignAction Action to Sign a document, the required attribute iValue defines the zero based PadEntryDialog page index which is activated to capture the signature, when the action is invoked strValue optional String parameter to execute the action when activated (clicked), see above for ScannerActions iValue optional integer parameter to execute the action when activated (clicked) LastSaved optional value that indicates to use the last recently saved value, applies to some actions --> <!ELEMENT PlCaption EMPTY > <!ATTLIST PlCaption Name CDATA #IMPLIED NameId CDATA #REQUIRED LangId CDATA #REQUIRED > <!-- Attributes: Name The text for this element, The name will be displayed if specified NameId an identifier to the language resource for this element LangId the language identifier to translate the element Note: the PLCaption element is provided for internal use only, e.g. to build a compatibility PadEntryOption descriptor, if the application does not pass PadEntryOption(s). --> <!ELEMENT PlFont EMPTY > <!ATTLIST PlFont Face CDATA #REQUIRED Size CDATA #REQUIRED Flags CDATA #IMPLIED > <!-- Attributes Face The face name Size The size of the font (in points) Flags a bitwise or of these values: 0x00000001 Bold 0x00000002 Italic 0x00000004 Underline 0x00000008 StrikeOut Note: the font size is entered in points. A point is an absolute value 1 / 72 inch. The Font size will be calculated in the source coordinate system, and then converted to the destination coordinate system. --> <!ELEMENT PlTablet (PlCoordinate?, PlIdleTimeout?) > <!ATTLIST PlTablet Flags CDATA #IMPLIED PenThickness CDATA #IMPLIED > <!-- Elements PlCoordinate clip rectangle coordinates of the signature region, optional, Origin should be Entry PlIdleTimeout optional idle timeout action Attributes Flags A a bitwise or of these values: 0x00000001 The clip rectangle will be applied when rendering strokes on the PC screen, vectors outside the clipping region will neither be rendered nor appended to the signature 0x00000002 The clip rectangle will be applied when rendering strokes on the tablet screen, if supported by the tablet 0x00000010 don't echo stroke vectors to the tablet display (useful for text only screens) 0x00000020 the tablet is used upside down (rotated by 180 degrees), ignored on Fullscreen devices such as TabletPC's or Wacom PL series 0x00000040 Force a black-white background image on the tablet, even if the tablet supports color images PenThickness Thickness of the pen to draw pen strokes, range 1 ... 255, 1: thin, 255 bold pen Note: Clip rectangle and Pen thickness are currently only supported owith SignPad STU-520. --> <!ELEMENT PlIdleTimeout (PlAction) > <!ATTLIST PlIdleTimeout Timeout CDATA #REQUIRED > <!-- Elements PlAction The action that should be invoked Timeout[mseconds] after the last tablet stroke Attributes IdleTimeout The OK Action will be invoked IdleTimeout[mseconds] after last stroke, 0 is unlimited --> <!ELEMENT PlRectangle (PlCoordinate, PlAction?) > <!ATTLIST PlRectangle Diameter CDATA #IMPLIED BgColor CDATA #IMPLIED FgColor CDATA #IMPLIED Flags CDATA #IMPLIED > <!-- Elements PlCoordinate the coordinates of the rectangle PlAction ignored Attributes Diameter The diameter of round edges, pass 0 to draw rectangle edges, the diameter in pixel is calculated as min(width_pixel, height_pixel) * Diameter / 100 BgColor Background color, 0x00rrggbb, pass 0xffffffff to define transparent window color FgColor Foreground color, 0x00rrggbb, pass 0xffffffff to define transparent window color, Flags A binary ored set of bits (prefix 0x to pass a hex number), required: 0x00000002 Draw the rectangle in the draw window Note the rectangle will also be drawn if the flag 'draw on image in entry window' is set. 0x00000004 Draw the rectangle on the LCD background image of the tablet 0x00000008 Draw the rectangle on the image in the entry window (this option will draw an equivalent image on the PC screen as sent to the tablet) @note the Rectangle has no native implementation --> <!ELEMENT PlButton (#PCDATA | PlCoordinate | PlAction | PlCaption | PlFont)* > <!ATTLIST PlButton Caption CDATA #IMPLIED Flags CDATA #REQUIRED ToolTip CDATA #IMPLIED BgColor CDATA #IMPLIED FgColor CDATA #IMPLIED Encoding (base64 | base64compressed) #IMPLIED > <!-- attributes Caption The caption text of the button, in UTF8 notation, requires a PLCaption element if omitted Flags A binary ored set of bits (prefix 0x to pass a hex number), required: 0x00000001 Draw the button in the Plugin window (Create a native Button), Origin may be either Plugin or Entry 0x00000002 Draw the button in the draw window (as a virtual button). The button will be drawn as a simple rectangle. Note the button will also be drawn if the flag 'draw on image in entry window' is set. 0x00000004 Draw the button on the LCD background image of the tablet (as a virtual button) 0x00000008 Draw the button on the image in the entry window (this option will draw an equivalent image on the PC screen as sent to the tablet) 0x00000100 Virtual button, clickable with the pen (default) 0x00000200 Virtual button, clickable with the mouse (should not be set for native buttons - native buttons are per se clickable with the mouse) ToolTip optional Tooltip-Text, requires a native window button BgColor Background color, 0x00rrggbb, pass 0xffffffff to define transparent window color FgColor Foreground color, 0x00rrggbb, pass 0xffffffff to define transparent window color Encoding optional Icon data format, required if an icon is passed PCDATA optional Icon data, may be a multi-page Icon, MS ICO Format --> <!ELEMENT PlText (PlCoordinate, PlFont?, PlAction?) > <!ATTLIST PlText Caption CDATA #REQUIRED Flags CDATA #REQUIRED TextFlags CDATA #REQUIRED ToolTip CDATA #IMPLIED BgColor CDATA #IMPLIED FgColor CDATA #IMPLIED > <!-- elements PlCoordinate the coordinates of the text object PlFont optional Font object PlAction optional action object, the action identifyer may be used to dynamicall update the text to the value of the action attributes Caption Caption text, in UTF8 notation Flags A binary ored set of bits (prefix 0x to pass a hex number), required: 0x00000001 Display the text in the Plugin window (Create a native Label) 0x00000002 Draw the text in the draw window (will not create a native static window) Note the text will also be drawn if the flag 'draw on image in entry window' is set. 0x00000004 Draw the text on the LCD background image of the tablet 0x00000008 Draw the text on the image in the entry window (this option will draw an equivalent image on the PC screen as sent to the tablet) TextFlags A binary ored set of bits (prefix 0x to pass a hex number): 0x00000000 Align top 0x00000000 Align left 0x00000001 center horizontally (default) 0x00000002 Align right 0x00000004 center vertically (default) 0x00000008 align bottom 0x00000010 auto word break (multi line) 0x00000020 single line (default) 0x00000040 expand tab characters ToolTip optional Tooltip-Text, requires a native text window BgColor Background color, 0x00rrggbb, pass 0xffffffff to define transparent window color FgColor Foreground color, 0x00rrggbb, pass 0xffffffff to define transparent window color, --> <!ELEMENT PlTextEntry (PlCoordinate, PlAction?, PlFont?)> <!ATTLIST PlTextEntry Name CDATA #REQUIRED Flags CDATA #REQUIRED Text CDATA #IMPLIED ToolTip CDATA #IMPLIED BgColor CDATA #IMPLIED FgColor CDATA #IMPLIED > <!-- elements PlCoordinate the coordinates of the text entry object PlAction the associated action, may be omitted PlFont optional font specifyer attributes Name the name of this entry, will be returned as ID in the anser request, reqired Flags A binary ored set of bits (prefix 0x to pass a hex number), required: 0x00000001 Display the text in the Plugin window (Create a native Text entry box) Text The textentry field will be prefilled with the text string Deprecated, pass the default text as url in the PlAction object ToolTip optional Tooltip-Text, requires a native TextEntry window BgColor Background color, 0x00rrggbb, pass 0xffffffff to define transparent window color FgColor Foreground color, 0x00rrggbb, pass 0xffffffff to define transparent window color, Note: the content of a text entry field is returned as 'Name'="'Text'", where 'Text' is read out of the entry field and returned in UTF8 notation, if the text entry is embedded in a PadDialog Note: a PlEntryText Object can only be created as a native Text entry box) --> <!ELEMENT PlSlider (PlCoordinate, PlAction)> <!ATTLIST PlSlider Minimum CDATA #REQUIRED Maximum CDATA #REQUIRED Page CDATA #REQUIRED Increment CDATA #REQUIRED Flags CDATA #REQUIRED ToolTip CDATA #IMPLIED BgColor CDATA #IMPLIED FgColor CDATA #IMPLIED > <!-- elements PlCoordinate the coordinates of the slider object PlAction the associated action attributes Minimum the minimum Slider value Maximum the maximum Slider value Page the page increment value Increment the minumum increment of the slider Flags A binary ored set of bits (prefix 0x to pass a hex number), required: 0x00000001 Display the text in the Plugin window (Create a native Slider) 0x00000002 Display the text in the Entry window (Draw a Slider) 0x00000004 Draw the image on the tablet screen (Draw a slider) 0x00000008 Draw the slider on the image in the entry window (this option will draw an equivalent image on the PC screen as sent to the tablet) 0x00010000 Create a horizontal slider, else create a vertical slider ToolTip optional Tooltip-Text, requires a native Slider window BgColor Background color, 0x00rrggbb, pass 0xffffffff to define transparent window color FgColor Foreground color, 0x00rrggbb, pass 0xffffffff to define transparent window color, Note the default slider position will be read from the associated action Note a slider within a document view will overwrite Minimum, Maximum, Page and Increment --> <!ELEMENT PlComboItem (PlAction)> <!ATTLIST PlComboItem Caption CDATA #REQUIRED > <!-- attributes Caption the caption text that will be displayed in the combo box --> <!ELEMENT PlComboBox (PlCoordinate, PlFont+, PlComboItem?)> <!ATTLIST PlComboBox Flags CDATA #REQUIRED ToolTip CDATA #IMPLIED BgColor CDATA #IMPLIED FgColor CDATA #IMPLIED > <!-- elements PlCoordinate the coordinates of the combo object PlFont optional font PlComboItem one or more items to select attributes Flags A binary ored set of bits (prefix 0x to pass a hex number), required: 0x00000001 Display the text in the Plugin window (Create a native Combo box) 0x00000002 Display the text in the Entry window (Create a native Combo box) ToolTip optional Tooltip-Text, requires a native Combo window BgColor Background color, 0x00rrggbb, pass 0xffffffff to define transparent window color FgColor Foreground color, 0x00rrggbb, pass 0xffffffff to define transparent window color, Note: a PlComboBox Object can only be created as a native Combo window) --> <!ELEMENT PlImage (#PCDATA | PlCoordinate)* > <!ATTLIST PlImage Format CDATA #REQUIRED Flags CDATA #REQUIRED Width CDATA #IMPLIED Height CDATA #IMPLIED TransparentColor CDATA #IMPLIED > <!-- elements PlCoordinate optional coordinates of the image object attributes Flags A binary ored set of bits(prefix 0x to pass a hex number) 0x00000002 Draw the image in the entry window 0x00000004 Draw the image on the tablet screen 0x00000008 Draw the image on the image in the entry window (this option will draw an equivalent image on the PC screen as sent to the tablet) 0x00001000 Draw the image opaque, default is transparent, transparent color is white Format Image format 1 fully qualified file name (on the local file system, http or ftp requests are not supported) 2 binary Image data (it may be difficult to embed binary data in a XML string) 3 Base64 coded Image data 4 Base64 coded compressed Image data 5 create an empty image (width and height must be specified) width Image width (optional, may be 0), required for empty images height Image height (optional, may be 0), required for empty images TransparentColor color that will be made transparent if the opaque bit is not set Note: the PlCoordinate is required, but the plugins will assign a default PlCoordinate (0, 1000, 0, 1000) for upward compatibility if the PlCoordinate is omitted Note: the passed image should be a Windows Bitmap format. PlImage will read gif, png, tiff and jpeg images, if GdiPlus is installed on the computer. The image should have a color resolution as required for the destination; the image should be black white if it should be inserted in a tablet LCD screen or true color for STU-520 devices. Note: Under Win XP: GdiPlus always converts b/w PNG images full color images, which might fail to render for a b/w tablet screen --> <!ELEMENT PlDocument (#PCDATA | PlCoordinate | PlSlider | PlButton)* > <!ATTLIST PlDocument Format CDATA #REQUIRED Flags CDATA #REQUIRED Width CDATA #IMPLIED Height CDATA #IMPLIED Zoom CDATA #REQUIRED TransparentColor CDATA #IMPLIED > <!-- elements PlCoordinate one PlCoordinate, coordinates of the document object PlSlider zero to two sliders to scroll the document, the assigned action is ignored, will always be scroll up / down in a vertical slider, and scroll left / right in a horizontal slider PlButton zero or more buttons associated to the document. The document object evaluates zoom in and zoom out actions (action ImageZoomAction with value = 1 / -1). The document object evaluates SignAction buttons, which invoke the specified dialog page, captures a signature, displays the signature in the button icon, and returns the signature. Other button actions may be prev / next page or OK attributes Flags A binary ored set of bits(prefix 0x to pass a hex number) 0x00000002 Draw the document in the entry window 0x00000004 Draw the document on the tablet screen 0x00000008 Draw the document on the image in the entry window (this option will draw an equivalent image on the PC screen as sent to the tablet) 0x00001000 Draw the document opaque, default is transparent, transparent color is white Format Image format 1 fully qualified file name (on the local file system, http or ftp requests are not supported) 2 binary Image data (it may be difficult to embed binary data in a XML string) 3 Base64 coded Image data 4 Base64 coded compressed Image data Zoom initial zoom, FitWidth, FitHeight, FitAll or a floating number TransparentColor color that will be made transparent if the opaque bit is not set Note: the passed document should be a Windows Bitmap format. PlDocument will read gif, png, tiff and jpeg images, if GdiPlus is installed on the computer. the document should be black white if it should be displayed on a tablet LCD screen or true color for STU-520 devices. Note: Under Win XP: GdiPlus always converts b/w PNG images to full color images, which might fail to render for a b/w tablet screen --> <!-- Numbers may be passed as decimal numbers, or as hexadecimal numbers if prefixed with '0x' or postfixed with 'h' -->
License restrictions
The SOFTPRO SignDoc and SOFTPRO Capture plugins are license restricted. The license may either be passed via an optional parameter (Auth) or checked on the local (client) host.If the Auth parameter is used then the Auth parameter must pass a valid license ticket. The plugins return a License error, if the Auth parameter does not contain a valid ticket.
The local license manager is only contacted if the Auth parameter is not passed or empty. Plugins require a 'BrowserPlugin' license fully installed on the local host. The file splm2.dll must be accessible in the path (or system32) folder.
Tablet creation parameters
A total of three parameters define the selection of a tablet.
- padclass the name of the tablet class that will be instantiated. These tablet classes are supported:
- SPTabletHidDrv interface to the SOFTPRO HID driver to access TabletPCs
- SPTabletInterlink interface to the SOFTPRO Interlink driver (SWILUniv)
- SPTabletMobinetix interface to Mobinetix driver
- SPTabletStepOver interface to StepOver BlueM and BlueM-LCD tablets
- SPTabletTopaz interface to Topaz 1X5, 4X3 and 4X5 SE LCD tablets
- SPTabletWSignPad interface to Wacom SignPad tablets
- SPTabletWacom interface to Wacom Intuos, Graphire, etc. tablets
- SPTabletWTablet interface to SOFTPRO eInk driver to access TabletPCs
- SPTabletVerifone interface to SOFTPRO driver to access Verifone Mx 800 series tablets
- SPTabletRemoteTablet interface to SOFTPRO driver to access Smartphones as tablets
- SPTabletGeneric interface to SOFTPRO driver to access drivers that implement the documented tablet access
- padconfiguration Optional configuration data. Configuration data equals the options as described in tablet.ini, depending on the detected tablet model:
- SPTabletHidDrv no configuration parameters
- SPTabletInterlink no configuration parameters
- SPTabletMobinetix no configuration parameters
- SPTabletStepOver pass the contents of the file tablet.ini, see Installation and configuration of various pads
- SPTabletTopaz pass the contents of the file tablet.ini, see Installation and configuration of various pads
- SPTabletWSignPad pass the contents of the file tablet.ini, see Installation and configuration of various pads
- SPTabletWacom no configuration parameters
- SPTabletWTablet no configuration parameters
- SPTabletVerifone pass the contents of the file tablet.ini, see Installation and configuration of various pads
- SPTabletRemoteTablet optional contents of the file tablet.ini, see Installation and configuration of various pads
- SPTabletGeneric no configuration on the server, or driver specific configuration
If a PadClass and a PadConfiguration is specified, then the tablet is searched in this order:- create a tablet device for the specified class and configuration and use it
- return error if no tablet found
- create a tablet tablets for the n'th class
- if a tablet device was found then use it
- If tablet creation failed for all classes then return error no tablet found
- create a tablet object using the default class search order
- if a tablet device was found then use it
- If tablet creation failed then return error no tablet found
- search for a tablet in compatibility mode, evaluate tablet.ini key 'FirstWT'
- return error if no tablet found
- padalias: specifies the TabletAlias string.
The TabletAlias is used as a lookup in the windows registry to read a unified resource location description, which includes the padclass and padconfiguration to create the tablet.
The ULOC will be located in the registry folder HKLM\SOFTWARE\SOFTPRO\tabletconfig\AliasName.
The Key ULOC contains a resource locator which describes the tablet class and further configuration properties.
ULOC format:
sptablet://class=ClassName[&connection={usb|tcpip|com}]&[connection_value=port_id]&options
where- class contains the name of the tablet class, see padclass for a list of valid tablet classes
- connection contains the interface used to connect to the tablet
- connection_value contains a interface identifyer, e. g. '-2' for second USB device, or '2' for COM2, or '192.168.1.15:1002' to address a tcpip interface
- options contains a '&' separated list of options as defined in the tablet.ini, see Installation and configuration of various pads
Note the browser plugins all include a fallback to use any pad if the specified padalias cannot be resolved on the host.
Document view / sign
Example to view and optionally 'sign' a document.
The example passes a document image with two signature fields. Two virtual buttons are included at the positions of the signature fields, which will invoke a signature capture dialog. The captured signatures will be displayed in the signature fields after confirmation.
The final result will return the captured signatures, the server may embed the signatures in the document, e.g. as a digital signature in a PDF document.
<?xml version="1.0" encoding="UTF-8"?> <PadEntryOptions> <PadEntryDialog BgColor="0xE0FFFF" FgColor="0xFF" Mandatory="true"> <PlCoordinate Origin="Plugin" Left="0" Right="1000" Top="0" Bottom="1000"/> <!-- The embedded Image is incompletely shown here --> <PlDocument Flags="0x6" Format="0x4" Zoom="FitHeight">eJwUl/cj1I/... <PlCoordinate Origin="Entry" Left="0" Right="1000" Top="100" Bottom="1000"/> <!-- The slider coordinates have origin 'NoOrigin' which will auto-layout the sliders --> <PlSlider BgColor="0xFFFF00" Flags="0x10306" Minimum="0x0" Maximum="0x3E8" Increment="0x1" Page="0xA"> <PlCoordinate Origin="NoOrigin" Left="0" Right="1000" Top="0" Bottom="1000"/> <PlAction Id="OKAction" LastSaved="false"/> </PlSlider> <PlSlider BgColor="0xFFFF00" Flags="0x306" Minimum="0x0" Maximum="0x3E8" Increment="0x1" Page="0xA"> <PlCoordinate Origin="NoOrigin" Left="0" Right="1000" Top="0" Bottom="1000"/> <PlAction Id="OKAction" LastSaved="false"/> </PlSlider> <PlButton Flags="0x306" Caption="OK" BgColor="0xFF00" FgColor="0xFF"> <PlCoordinate Origin="Entry" Left="25" Right="325" Top="10" Bottom="90"/> <PlAction Id="OKAction" LastSaved="false"/> <PlFont Face="0" Size="0xC" Flags="0x0"/> </PlButton> <PlButton Flags="0x306" Caption="Zoom -" BgColor="0xFF0000" FgColor="0x0"> <PlCoordinate Origin="Entry" Left="350" Right="650" Top="10" Bottom="90"/> <PlAction Id="ImageZoomAction" iValue="0xFFFFFFFF" LastSaved="false"/> <PlFont Face="0" Size="0xC" Flags="0x0"/> </PlButton> <PlButton Flags="0x306" Caption="Zoom +" BgColor="0xFF0000" FgColor="0x0"> <PlCoordinate Origin="Entry" Left="675" Right="975" Top="10" Bottom="90"/> <PlAction Id="ImageZoomAction" iValue="0x1" LastSaved="false"/> <PlFont Face="0" Size="0xC" Flags="0x0"/> </PlButton> <!-- Siganture field 1 The coordinates of the signature fields on the doocument must be known and passed --> <PlButton Flags="0x306" Caption="" BgColor="0xFFFFFFFF" FgColor="0x0"> <PlCoordinate Origin="Document" Left="542" Right="730" Top="786" Bottom="823"/> <PlAction Id="SignAction" iValue="0x1" LastSaved="false"/> <PlFont Face="0" Size="0xC" Flags="0x0"/> </PlButton> <!-- Signature field 2 The coordinates of the signature fields on the doocument must be known and passed --> <PlButton Flags="0x306" Caption="" BgColor="0xFFFFFFFF" FgColor="0x0"> <PlCoordinate Origin="Document" Left="736" Right="947" Top="786" Bottom="823"/> <PlAction Id="SignAction" iValue="0x2" LastSaved="false"/> <PlFont Face="0" Size="0xC" Flags="0x0"/> </PlButton> </PlDocument> </PadEntryDialog> <!-- This dialog is not mandatory, the signature must not necessarily be entered --> <PadEntryDialog Mandatory="false"> <PlCoordinate Origin="Plugin" Left="0" Right="1000" Top="0" Bottom="850"/> <PlText TextFlags="0x21" Flags="0x6" Caption="Signature field 1"> <PlCoordinate Origin="Entry" Left="0" Right="1000" Top="800" Bottom="900"/> </PlText> <!-- The OK button invokes a GoPageAction which shows page 0 (the document) --> <PlButton Flags="0x306" Caption="OK"> <PlCoordinate Origin="Entry" Left="25" Right="325" Top="900" Bottom="990"/> <PlAction Id="GoPageAction" iValue="0x0" LastSaved="false"/> <PlFont Face="0" Size="0xC" Flags="0x0"/> </PlButton> <PlButton Flags="0x306" Caption="Erase"> <PlCoordinate Origin="Entry" Left="350" Right="650" Top="900" Bottom="990"/> <PlAction Id="EraseAction" LastSaved="false"/> <PlFont Face="0" Size="0xC" Flags="0x0"/> </PlButton> <PlButton Flags="0x306" Caption="Cancel"> <PlCoordinate Origin="Entry" Left="675" Right="975" Top="900" Bottom="990"/> <PlAction Id="CancelAction" LastSaved="false"/> <PlFont Face="0" Size="0xC" Flags="0x0"/> </PlButton> <!-- The embedded Image is incompletely shown here --> <PlImage Flags="0x6" Format="0x4">eJzt3...</PlImage> </PadEntryDialog> <!-- This dialog is not mandatory, the signature must not necessarily be entered --> <PadEntryDialog Mandatory="false"> <PlCoordinate Origin="Plugin" Left="0" Right="1000" Top="0" Bottom="850"/> <PlText TextFlags="0x21" Flags="0x6" Caption="Signature field 2"> <PlCoordinate Origin="Entry" Left="0" Right="1000" Top="800" Bottom="900"/> </PlText> <!-- The OK button invokes a GoPageAction which shows page 0 (the document) --> <PlButton Flags="0x306" Caption="OK"> <PlCoordinate Origin="Entry" Left="25" Right="325" Top="900" Bottom="990"/> <PlAction Id="GoPageAction" iValue="0x0" LastSaved="false"/> <PlFont Face="0" Size="0xC" Flags="0x0"/> </PlButton> <PlButton Flags="0x306" Caption="Erase"> <PlCoordinate Origin="Entry" Left="350" Right="650" Top="900" Bottom="990"/> <PlAction Id="EraseAction" LastSaved="false"/> <PlFont Face="0" Size="0xC" Flags="0x0"/> </PlButton> <PlButton Flags="0x306" Caption="Cancel"> <PlCoordinate Origin="Entry" Left="675" Right="975" Top="900" Bottom="990"/> <PlAction Id="CancelAction" LastSaved="false"/> <PlFont Face="0" Size="0xC" Flags="0x0"/> </PlButton> <!-- The embedded Image is incompletely shown here --> <PlImage Flags="0x6" Format="0x4">eJzt3...</PlImage> </PadEntryDialog> </PadEntryOptions>
Function 'Scanner'
Capture an image from the scanner on the local (client) computer.Please note that this function requires the Microsoft module Gdiplus, Version 1.0. Function 'Scanner' will return an error if Gdiplus ist not accessible.
Parameters:
- width: the width of the visible plugin window, may be 0, Integer parameter
- height: the height of the visible plugin window, may be 0, Integer parameter
- function: the function, must be "Scanner", String parameter
- sendTo: the uri of servlet to pass the result, String parameter
- target: specify the result target window, String parameter
- str: response stream type, must be 'url', String parameter
- PlOptions: XML description of the function, the root element of the description must be ScannerEntryOptions, see Pad / Scanner Options DTD , base64 encoded string
- auth: a valid license ticket, optional, base 64 encoded string, see License restrictions, Base64-encoded data, optionally, else a local BrowserPlugin License may be used
- PlOEncoding: encoding of PLOptions, String parameter
- "base64" PLOptions is base64 encoded
- "base64compressed" PLOptions is zlib compressed and base64 encoded
- "nibblehex" PLOptions is nibble-hex encoded
- "nibblehexcompressed" PLOptions is zlib compressed and nibble-hex encoded
- rc: the final result, Integer return, Standard return values
- pluginversion: the version of the plugin, e. g. 2.1.2.0, since Version 2.1.2.0, String return
- images: only if successfull, the image data as a base64 encoded zip-compressed binary array, Base64-encoded String return
Image files within the zip data structure are named Image{sequential number}.extension, the extensions equals the typical extension for the image format. - image0: only if successfull, the data of the first image as a base64 encoded raw binary array, Base64-encoded String return The image format equals the requested image format for the sequential image
- image1: only if successfull, the data of the second image as a base64 encoded raw binary array, Base64-encoded String return The image format equals the requested image format for the sequential image
- image(n): only if successfull, the data of the (n)th image as a base64 encoded raw binary array, Base64-encoded String return The image format equals the requested image format for the sequential image
- encoding: only if successfull, the encoding 'Base64Zip', 'Base64UrlRaw', 'Base64Raw' or 'Base64UrlZip', String return
The parameter images will be filled, if encoding contains the string 'zip', the parameters image0, image1, ... image(n) will be filled if encoding contains the string 'raw'.
- ScannerCapture: the dialog will capture and edit an image
- ScannerSettings: the dialog will define the settings to capture an image
Major difference against ScannerCapture: a scan command will be interpreted as a preview request, it will always capture the max. scan range, resolution will be adjusted to screen resolution The OK Action will close the ScannerSettings dialog and return to the ScannerCapture dialog which invoked the ScannerSettings command. An image will be captured, if the settings dialog was implicitly or explicitly opened as part of the scan action, see ScanImageAction for details. - ScannerSelectSource: the dialog is currently treated same as ScannerSettings
- ImageWindow: Display an image with mouse interaction to edit the window
Default mouse interaction: zoom in / out (left / right double click), move the viewport (right mouse drag) and crop parts of the image (left mouse drag) - ToolWindow: container of buttons, sliders, text and other tools / actions.
- VideoWindow: display the live stream from a video camera. The VideoWindow class is required to connect to a DirectShow source. A DirectShow capture will display the video stream in the VideoWindow and copy the snapshot taken into the ImageWindow for further processing.
A ToolWindow hosts several GUI elements such as Buttons (PlButton), Sliders (PlSlider), TextEntry fields (PlTextEntry), Combo boxes (PlComboBox) and text elements (PlText). Each GUI element has a coordinate object that defines the position of the element relative to the window (Origin = Entry) or relative to the dialog (Origin = plugin). Each GUI element also requires an action identifyer (PlAction) which defines the command that will be invoked whenever invoked. The action includes an attribute to define, if the last recently used setting will be reloaded during initialisation.
The plugin saves settings in the registry, the root key is HKCU\software\softpro\plugins\scanner.
PlText elements wich have an assigned action will be synchronized to the corresponding GUI element with the same action identifyer.
Action commands:
- OKAction OK button, action depends on the dialog type
- ScannerCapture dialog: pass the captured images to the sendTo servlet
- ScannerSettings dialog: return to the calling ScannerCapture dialog, capture an image if the ScannerSettings was opened implicitly
- CancelAction Cancel button, close the plugin, return CANCEL_ERR to the sendTo servlet
- NextAction Show the next ScannerCapture dialog page
- PrevAction Show the previous ScannerCapture dialog page
- GoPageAction Show the nth ScannerCapture dialog page, the zero based page number is defined by the iValue parameter
- ScannerSelectAction Select a Scanner. If the action is embedded in a PlComboBox then the CombboBoxItems will be filled with identifyers of the scanners found during plugin initialisation If the action is assigned to a PlText element then the text element will be updated with the name of the currently selected scanner
The last selection will always be restored - ScannerPapersizeAction Select a Papersize, iValue contains the enum representation of the papersize. All elements with action ScannerLeftAction, ScannerTopAction, ScannerWidthAction or ScannerHeightAction will be updated to the selected paper size
The last selection will be restored if LastUsed is set to true. - ScannerThresholdAction Set the binarisation threshold of the scanner, iValue contains the (initial) Threshold, range 0 ... 255. Threshold is typically assigned to a PlSlider element.
The last selection will be restored if LastUsed is set to true. - ScannerBrightnessAction Set a Brightness of a scanner, iValue contains the (initial) Brightness, range 0 .. 1000. Brightness is typically assigned to a PlSlider element.
The last selection will be restored if LastUsed is set to true. - ScannerContrastAction Set a Contrast of a scanner, iValue contains the (initial) Contrast, range 0 ... 1000. Contrast is typically assigned to a PlSlider element.
The last selection will be restored if LastUsed is set to true. - ScannerBitdepthAction Set a Bitdepth of a scanner, iValue contains the (initial) Bitdepth, possible values are 1, 8, 24, 32. The bitdepth is typically assigned to a PlComboBox, each PlComboItem holds the bit depth in the assigned PlAction iValue, and a description in caption, e. g. caption="Gray", PlAction iValue = "8".
The last selection will be restored if LastUsed is set to true. - ScannerResolutionAction Set the Resolution of a scanner, iValue contains the (initial) Resolution [DPI]. The Resolution is typically assigned to a PlSlider or a PlComboBox.
The last selection will be restored if LastUsed is set to true. - ScannerLeftAction Set the left corner of a scan capture, iValue contains the (initial) left coordinate [mm]
The last selection will be restored if LastUsed is set to true. - ScannerTopAction Set the top corner of a scan capture, iValue contains the (initial) top coordinate [mm]
The last selection will be restored if LastUsed is set to true. - ScannerWidthAction Set the width of a scan capture, iValue contains the (initial) width [mm]
The last selection will be restored if LastUsed is set to true. - ScannerHeightAction Set the height of a scan capture, iValue contains the (initial) height [mm]
The last selection will be restored if LastUsed is set to true. - ScannerLightsourceAction Set the scanner light source, iValue contains the enum representation of the lightsource
The last selection will be restored if LastUsed is set to true. - ScanImageAction Scan an Image, iValue is a bitwise or of these values:
- 1 show the settings dialog before scanning an image, show the vendor GUI if no settings dialog is defined
- 2 show the vendor scan GUI to capture an image
- 0x1000 auto clean the background, only for gray images, implicitly calls ImageWhitenBackgroundAction
- ScanSettingsAction Display a Settings dialog and scan an image
- ImageInvertAction Invert the displayed image
- ImageMirrorAction Mirror the displayed image, iValue is a bitwise or of
- 1 mirror horizontal
- 2 mirror vertical
- ImageRotateAction Rotate the displayed image, iValue is the angle in degrees, 90, 180 or 270
- ImageUndoAction Undo the last image processing command
- ImageCropAction Select a crop region with the mouse (left button drag), and cut the selected region when releasing the left mouse button. The mouse drag will be ignored if the mouse is release out of the image window. ImageCrop is the default mouse action unless ImageEdit is active, if the attribute 'AllowCrop' in the element 'ScannerDialog' is set to true (default).
- ImageEditAction Draw white (right mouse button) or black (left mouse button) over the image using a pen with a diameter defined by ImagePensizeAction, the default pen is 3 (image) pixel wide. The action behaves like a toggle function, it will be turned on and off in successive calls. IValue is a bitwise or of edit flags:
- 1 swap left and right mouse button. Left mouse button draws black if the flag is not set
- 2 do not allow to write in foreground color (black)
- 4 do not allow to write in background colorr (white)
- ImagePensizeAction Set the pen size for drawing in the image, iValue defines the pen diameter in (image) pixel
The last selection will be restored if LastUsed is set to true. - ImageZoomAction Image Zoom action will either directly zoom in (iValue == 1) / out (iValue = -1) at the current center position, or use the mouse (iValue = 0) to zoom in / out with left / right mouse click, the center point will be set to the mouse position. The action behaves like a toggle function, it will be turned on and off in successive calls (if iValue = 0). Note: Right / Left double clicks may also zoom in / out, if mouse click events can be ignored (ImageCropAction, mouse clicks do not modify the image).
- ImageCleanLinesAction clean horizontal and or vertical lines, iValue passes a bitwise or of
- 1 clean horizontal lines
- 2 to clean vertical lines
- ImageCleanWeightAction Set the weight for the next ImageCleanRectAction, iValue passes the weight, range 0 ... 1000
- ImageCleanRectAction Clean all rectangles with a weight less than the current weight, iValue holds the initial weight, range 0 ... 1000
- ImageWhitenBackgroundAction Set all pixels to white, if the value is larger than 80 % of the mean background level or 10 % background level, can be applied to gray images only
- FileOpenAction Popup a FileOpen dialog, strValue contains a list of strings that are separated by '|' characters. The first part includes the title, the other strings are couples of file description and file extension mask, e. g. 'Open Read me files|Text files(*.txt;*.me)|*.txt;*.me',
The last recently opened path will always be restored.
The plugin reads global ScannerSettings element in the ScannerDialog, and updates the settings from the GUI elements that have the according PlAction identifyer. Scanner settings are read in this order:
- from selected scanner (defaults)
- from global ScannerSettings element in the dialog
- from tools within the ScannerSettings dialog
- from tools within the ScannerCapture dialog
- DeviceName, 1, string, read only, name of the scanner device
- DeviceDescription, 2, string, read only, description of the scanner device
- DriverClassName, 3, string, read only, name of the scanner driver class
- DriverName, 4, string, read only, name of the scanner driver
- VendorName, 5, string, read only, name of the scanner vendor
- FirmwareVersion, 6, string, read only, firmware version of the vendor driver
- DeviceId, 7, string, read only, unique identifyer of the scanner
- DeviceType, 8, enum DeviceType, read only
- Papersize, 9, enum Papersize, pass the numeric enum value or by name (e.g. "A4")
- Width, 10, int, width in mm (pixel for cameras)
- OffsetX, 11, int left corner in mm (pixel for cameras)
- Height, 12, int, height in mm (pixel for cameras)
- OffsetY, 13, int, top corner in mm (pixel for cameras)
- ResolutionX, 14, int, resolution DPI
- ResolutionY, 15, int, resolution DPI
- ImageFormat, 16, enum ImageFormat, pass by the numeric enum value or by name (e.g. "Bmp")
- BitsPerPixel, 17, int 1 or 8 or 24
- Threshold, 18, int, range 0 ... 255
- Contrast, 19, int, range 0 ... 1000
- Brightness, 20, int, range 0 ... 1000
- LightSource, 21, enum LightSource, pass by the numeric enum value or by name (e.g. "Red")
- ThumbWidth, 22, int, width in pixel, only for camera preview
- ThumbHeight, 23, int, height in pixel, only for camera preview
- CaptureAsynchronous, 24, bool, unsupported
- CanReacquire, 25, bool, read only
- HasDuplex, 26, bool, read only
- CanUserGui, 27, bool read only
- DeviceName, 1, string, read only, name of the scanner device
- DeviceDescription, 2, string, read only, description of the scanner device
- DriverClassName, 3, string, read only, name of the scanner driver class
- DriverName, 4, string, read only, name of the scanner driver
- VendorName, 5, string, read only, name of the scanner vendor
- FirmwareVersion, 6, string, read only, firmware version of the vendor driver
- DeviceId, 7, string, read only, unique identifyer of the scanner
- DeviceType, 8, enum DeviceType, read only
- Width, 10, int, width in mm (pixel for cameras)
- Height, 12, int, height in mm (pixel for cameras)
- BitsPerPixel, 17, int 1 or 8 or 24
enum Papersize:
- Custom, 1
- A0, 2
- A1, 3
- A2, 4
- A3, 5
- A4, 6
- A5, 7
- A6, 8
- A7, 9
- A8, 10
- B2, 11
- B3, 12
- B4, 13
- B5, 14
- B6, 15
- C3, 16
- C4, 17
- C5, 18
- C6 19
enum DeviceType
- Default, 1
- Scanner, 2
- Camera, 3
- Video 4
enum LightSource
- Default 1
- Red, 2
- Green, 3
- Blue, 4
- None, 5
- White, 6
- UV, 7
- IR, 8
enum Image Format
- None 1
- Bmp, 2
- Tiff, 3
- Jpeg, 4
- Png, 5
- Gif 6
The final OK button checks if all ScannerCapture dialogs contain an image, and pops up a message if any images are missing. The user can exit with the cancel button, or he must fill all images.
Note on Signature cleaning
Some features have been included which are optimized for Signature cleaning. Signature cleaning is available for black/white and for gray images.
Signature cleaning includes calculation of weighted frames. The image is split into frames, and a weight is assigned to each frame which gives an indication of the trust that a frame is a part of a signature, or is dirt, or a line etc.
The plugin uses some external libraries which calculate the rectangles including the associated weight. These libraries must thus be accessible locally on the host computer (which requires an additional installation of the package) or must be accessible through a web service. The web service will be used if the element ServiceAccess is added and the url of the service is defined.
The external libraries include: fsxtk.dll, fsxtkkrn.dll, tifflib.dll
The weighted rectangles are calculated whenever the image is modified, however the rectangles will not be recalculated while editing an image (the rectangles will be recalculated 2 seconds after the last mouse release event).
- Note:
- This function is license restricted in SOFTPRO SignDoc and SOFTPRO Capture plugins. You must either install a 'BrowserPlugin' License or pass a valid 'Auth' Parameter, License restrictions.
Internet Explorer: You must turn off 'Protected Mode' if you do not use the Auth mechanism.
- Todo:
- Implement Keyboard navigation
Xml-description of the Webservice required for cleaning
<?xml version="1.0"?> <wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schema.example.com" targetNamespace="http://schema.example.com"> <wsdl:types> <xsd:schema targetNamespace="http://schema.example.com"> <xsd:complexType name="WeightedRectArray"> <xsd:complexContent> <xsd:restriction base="SOAP-ENC:Array"> <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="tns:WeightedRect[]"/> </xsd:restriction> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="WeightedRect"> <xsd:all> <xsd:element name="iBottom" type="xsd:int"/> <xsd:element name="iLeft" type="xsd:int"/> <xsd:element name="iRight" type="xsd:int"/> <xsd:element name="iTop" type="xsd:int"/> <xsd:element name="iWeight" type="xsd:int"/> </xsd:all> </xsd:complexType> </xsd:schema> </wsdl:types> <message name="cleanFramesRequest"> <part name="aImage" type="xsd:string"/> <part name="iWeight" type="xsd:int"/> </message> <message name="cleanFramesResponse"> <part name="cleanFramesReturn" type="xsd:string"/> </message> <message name="getWeightedFramesRequest"> <part name="aImage" type="xsd:string"/> </message> <message name="getWeightedFramesResponse"> <part name="getWeightedFramesReturn" type="tns:WeightedRectArray"/> </message> <wsdl:portType name="SivalServicePortType"> <wsdl:operation name="SivalService"/> <wsdl:operation name="cleanFrames"> <wsdl:input message="tns:cleanFramesRequest"/> <wsdl:output message="tns:cleanFramesResponse"/> </wsdl:operation> <wsdl:operation name="getWeightedFrames"> <wsdl:input message="tns:getWeightedFramesRequest"/> <wsdl:output message="tns:getWeightedFramesResponse"/> </wsdl:operation> </wsdl:portType> <binding name="SivalServiceBinding" type="tns:SivalServicePortType"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="SivalService"> <soap:operation soapAction="http://sw-bapi/service.php?class=SivalService&method=SivalService" style="rpc"/> </wsdl:operation> <wsdl:operation name="cleanFrames"> <soap:operation soapAction="http://sw-bapi/service.php?class=SivalService&method=cleanFrames" style="rpc"/> <wsdl:input> <soap:body use="encoded" namespace="http://schema.example.com" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </wsdl:input> <wsdl:output> <soap:body use="encoded" namespace="http://schema.example.com" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="getWeightedFrames"> <soap:operation soapAction="http://sw-bapi/service.php?class=SivalService&method=getWeightedFrames" style="rpc"/> <wsdl:input> <soap:body use="encoded" namespace="http://schema.example.com" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </wsdl:input> <wsdl:output> <soap:body use="encoded" namespace="http://schema.example.com" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </wsdl:output> </wsdl:operation> </binding> <wsdl:service name="SivalService"> <wsdl:port name="SivalServicePort" binding="tns:SivalServiceBinding"> <soap:address location="http://sw-bapi/service.php?class=SivalService"/> </wsdl:port> </wsdl:service> </wsdl:definitions>
// sample framework of the web service in php /** * WeightedRect * Container for rectangle coordinates and the associated weight */ class WeightedRect { /** * @var int left coordinate */ var $iLeft; /** * @var int Top coordinate */ var $iTop; /** * @var int right coordinate */ var $iRight; /** * @var int bottom coordinate */ var $iBottom; /** * @var int the weight */ var $iWeight; /** * Constructor * @param int $iLe Left coordinate * @param int $iTo Top coordinate * @param int $iRi Right coordinate * @param int $iBo Bottom coordinate * @param int $iWe Weight * @return void */ function WeightedRect($iLe, $iTo, $iRe, $iBo, $iWe) { $this->iLeft = $iLe; $this->iTop = $iTo; $this->iRight = $iRe; $this->iBottom = $iBo; $this->iWeight = $iWe; } } class SivalService { /** * Constructor * @return void */ function SivalService() { } /** * Request the weighted frames * * @param string $aImage the base64 encode image to analyze * @return WeightedRect[] an array of class WeightedRect */ function getWeightedFrames($aImage) { try { $sw = new SPSignWare(); $im = new SPImage(); $aImage = str_replace(" ", "+", $aImage); $im->setBase64Bitmap($aImage); $frames = $im->getFrames(); $result = array(); for($ik = 0; $ik < $frames->getCount(); $ik++) { $result[$ik] = new WeightedRect( $frames->getLeft($ik), $frames->getTop($ik), $frames->getRight($ik), $frames->getBottom($ik), floor($frames->getWeight($ik) * 1000.0) ); } return $result; } catch(Exception $ex) { trace(1, "getWeightedFrames(): cannot query frames, " . $ex->getMessage()); } return new SoapFault("-8", "Signware Error: cannot get SignWare frames"); } /** * Clean an image * * @param string $aImage the base64 encoded image to clean * @param int $iWeight the frame weight for cleaning, range 0 ... 1000 * @return string the base64 encoded cleaned image */ function cleanFrames($aImage, $iWeight) { try { $sw = new SPSignWare(); $im = new SPImage(); $aImage = str_replace(" ", "+", $aImage); $im->setBase64Bitmap($aImage); $im->cleanFrames((1.0 * $iWeight) / 1000.0); $ff = new SPFlatFile(); $ff->createFromImage($im, 1 /* SP_IMAGE_BMP_WIN */ | 0x200000 /* SP_IMAGE_BLACKWHITE_1BPP */); return $ff->getBase64Data(); } catch(Exception $ex) { trace(1, "getWeightedFrames(): cannot query frames, " . $ex->getMessage()); } return new SoapFault("-8", "Signware Error: cannot SignWare clean frames"); } } $server = new SoapServer("wsdl/SivalService.wsdl", array( 'encoding' => 'utf-8', 'soap_version' => SOAP_1_2)); $server->setClass('SivalService'); $server->handle(); ?>