Skip to content

ibrahimker/ionic-signature-pad

Repository files navigation

Ionic Signature Pad

This is an ionic 4 plugin to input signature based on wulfsolter repository. It's HTML5 canvas based and uses variable width Bézier curve interpolation based on Smoother Signatures post by Square. It works in all modern desktop and mobile browsers and doesn't depend on any external libraries. Example

Disclaimer

This project was tested in ionic 4.0.0-beta.15 for my personal purposes

How to use

  1. Install the plugin
npm install ionicsignaturepad
  1. Import and add in app.module.ts
....
import { IonicSignaturePadModule,IonicsignaturepadProvider } from 'ionicsignaturepad';
....
  1. In app.module.ts, add the module and provider to imports and providers sections
imports {
....
IonicSignaturePadModule,
....
}

providers [
....
IonicsignaturepadProvider,
....
]
  1. In component.module.ts, import and export the component
...
import { IonicSignaturePadModule, IonicsignaturepadComponent } from 'ionicsignaturepad';
...
imports:[
IonicSignaturePadModule
]
...
exports: [
...
IonicsignaturepadComponent,
...
]
  1. Use it in respective html like this:
<ion-signaturepad [(ngModel)]="signature"></ion-signature>

//Base 64 image of the signature
<p>{{signature}}</p>
  1. You can also use it with optional options:
<ion-signaturepad [(ngModel)]="signature" [canvasWidth]="300" [canvasHeight]="300" [backgroundColor]="#ffffff"></ion-signature>

//Base 64 image of the signature
<p>{{signature}}</p>

Releases

No releases published

Packages

No packages published