sf-signpdf
v0.1.2
Published
Librería Angular para firma digital de documentos PDF con soporte para múltiples métodos de autenticación.
Downloads
28
Readme
SignPdf
Librería Angular para firma digital de documentos PDF con soporte para múltiples métodos de autenticación.
Características
- ✅ Firma de documentos PDF
- ✅ Autenticación por SMS y Email
- ✅ Firma con dibujo (signature pad)
- ✅ Soporte multiidioma (ES/EN)
- ✅ Configuración flexible de servidores
- ✅ Standalone components
Instalación
This project was generated using Angular CLI version 19.2.0.
Servicios Incluidos
PostService
Servicio principal para realizar peticiones HTTP a los diferentes servidores backend.
ServiceDocumentos
Servicio especializado para operaciones relacionadas con documentos y firmas digitales.
Configuración
La librería necesita la URL del servidor de documentos. Tienes dos opciones para configurarla:
Opción 1: Configuración mediante Providers (Recomendado)
import { ApplicationConfig } from '@angular/core';
import { provideHttpClient } from '@angular/common/http';
import { SERVER_CONFIG_TOKEN } from 'sign-pdf';
export const appConfig: ApplicationConfig = {
providers: [
provideHttpClient(),
{
provide: SERVER_CONFIG_TOKEN,
useValue: { ServidorDocumentos: 'https://mi-servidor.com/api/' }
}
]
};Opción 2: Configuración mediante SessionStorage
const config = {
ServidorDocumentos: 'https://mi-servidor.com/api/'
};
sessionStorage.setItem('ConfigJSON', JSON.stringify(config));Uso del Componente
import { Component } from '@angular/core';
import { SignPdfComponent } from 'sign-pdf';
@Component({
selector: 'app-root',
standalone: true,
imports: [SignPdfComponent],
template: `<app-sign-pdf></app-sign-pdf>`
})
export class AppComponent {}Configuración de Rutas
import { Routes } from '@angular/router';
import { SignPdfComponent } from 'sign-pdf';
export const routes: Routes = [
{
path: 'sign-pdf/:sIdKatios/:sIdDoc/:sNoDoc/:sTDoc/:sNDoc',
component: SignPdfComponent
}
];Dependencias Requeridas
npm install @angular/material ng2-pdf-viewer signature_padInterfaz ServerConfig
interface ServerConfig {
ServidorDocumentos?: string;
}La configuración por defecto apunta a: https://localhost:7105/
Code scaffolding
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
ng generate component component-nameFor a complete list of available schematics (such as components, directives, or pipes), run:
ng generate --helpBuilding
To build the library, run:
ng build sign-pdfThis command will compile your project, and the build artifacts will be placed in the dist/ directory.
Publishing the Library
Once the project is built, you can publish your library by following these steps:
Navigate to the
distdirectory:cd dist/sign-pdfRun the
npm publishcommand to publish your library to the npm registry:npm publish
Running unit tests
To execute unit tests with the Karma test runner, use the following command:
ng testRunning end-to-end tests
For end-to-end (e2e) testing, run:
ng e2eAngular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
Additional Resources
For more information on using the Angular CLI, including detailed command references, visit the Angular CLI Overview and Command Reference page.
