ngx-digital-signature. This is an angular library, which allows you to enter and download digital signatures in different formats. Whether jpg
, png
, jpeg
, svg
and more.
Generate a new project with angular-cli
ng new app
Install the dependency.
npm i ngx-digital-signature
Add the following content in the app.module.ts
file.
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
// Import library ❤️
import { NgxDigitalSignatureModule } from 'ngx-digital-signature';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent,
],
imports: [
BrowserModule,
// Add library to start 🚀
NgxDigitalSignatureModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {}
Now, add the component to app.component.html
<ngx-digital-signature [options]="{...}"></ngx-digital-signature>
Ready, you can add your signatures.
In this section you will find all the properties and functionalities of the library.
This is an object that corresponds to the header of the component, here you can add the logo of your company or app (in String format), and also a title (in String format). For default is undefinded
This corresponds to the thickness of the pencil (in Number format). For default is 0.5
This is the primary color of the component, this color is added to the card in general (in String format). For default is #ffffff
Add a secondary color to the component, this is reflected in buttons, letters, etc (in String format). For default is #5c83e1
Sets all the pencil colors (in Array format). For default ["black", "#5c83e1"]
Sets all available image formats (in Array format). For default.
[
{ extension: "jpg" },
{ extension: "png" },
{ extension: "svg", contentType: "svg+xml" }
]
Sets the height of the canvas (in Number format). For default is 200
Sets the width of the canvas (in Number format). For default is 400
Add a background to the canvas (in String format). For default is rgba(0, 0, 0, 0.05)
Set the color of the pencil (in String format). For default is black
Add a short description below the canvas (in String format). For default is undefined