1.1.2 • Published 7 years ago

@raincatcher/step-signature v1.1.2

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

Signature generic step

FeedHenry RainCatcher generic step implementing signatures.

Setup

This module is packaged in a CommonJS format, exporting the name of the Angular namespace. The module can be included in an angular.js as follows:

Require the browserify dependency as an angular module

angular.module('app', [require('fh-wfm-signature').ngModule])

Client-side usage

Collecting signatures

The Base64 encoded signature will be assigned to the value attribute of the signature-form directive.

Default mime-type is image/png, however, this can be overriden by passing mime-type value via encoding attribute.

The image quality can also be adjusted by setting the image-quality attribute. See table below for details.

NameLowmediumHigh
image/jpeg0.10.51
image/png0.10.51
image/webp0.10.51
<signature-form value="ctrl.model" encoding="image/jpeg" image-quality="0.5"></signature-form>

Displaying signatures

The src attribute of the image tag is bound to the value attribute of the signature tag. To display a base64 encoded string, prefix it with the string: data:image/png;base64,

<signature value="ctrl.model"></signature>

Signature CSS styles

Include the module SASS file in your application sass:

@import 'node_modules/@raincatcher/step-signature/lib/signature.scss

Directives

NameAttributes
signature-formvalue, options, encoding, image-quality
signaturevalue