edatalia-websign-panel
v1.0.4
Published
Modern signature panel library for web applications
Maintainers
Readme
WebSign Panel
WebSign Panel is a JavaScript library developed by Edatalia that provides a complete signature panel interface for managing multiple signers on PDF documents. It integrates with the edatalia-websign library to handle the actual signature capture.
Important: WebSign Panel works exclusively over HTTPS and with UTF-8 encoding.
✨ Features
- Multi-signer management with grouped lists
- PDF viewer with print support
- Support for different signature types: DTU, STU, display, certificate
- Configurable UI buttons (cancel, print, finish)
- Auto-sign capability
- Multi-language support (es, eu)
- EBP templates for Wacom devices
📦 Installation
NPM
npm install edatalia-websign-panelThen, import both libraries in your JavaScript application:
import 'edatalia-websign'; // Required - registers window.WebSign
import { WebSignPanel } from 'edatalia-websign-panel';CDN
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script src="https://cdn.jsdelivr.net/npm/edatalia-websign-panel@latest"></script>When using CDN, WebSignPanel is available globally:
const panel = new WebSignPanel(null, config, callback);In your HTML, place the following container:
<div id="web-sign-panel"></div>🚀 Basic Usage
Note: WebSignBridge is optional. If it's running, it enhances the use of websign panel.
const config = {
settings: {
bearerToken: "your-bearer-token",
signatureEnvironment: "SANDBOX", // or "PRO"
language: "es",
showCancelButton: true,
showFinishButton: true,
showSignPaperButton: false,
ebpPath: "/assets/ebp"
},
document: {
pdfUrl: "/path/to/document.pdf"
},
signers: [
{
signerId: "signer-1",
label: "Patient Signature",
isMandatory: true,
signatureType: "dtu",
widget: {
type: "float",
text: "SIGN_HERE",
width: 160,
height: 100
}
}
]
};
const panel = new WebSignPanel(null, config, (event) => {
switch (event.type) {
case "completed":
console.log("Signed PDF:", event.data);
console.log("Updated config:", event.config);
break;
case "cancel":
console.log("User cancelled");
break;
case "error":
console.error("Error:", event.error);
break;
}
});Constructor Parameters
new WebSignPanel(pdfData, config, callback)| Parameter | Type | Description |
|-----------|------|-------------|
| pdfData | File\|Blob\|string\|null | PDF file, Blob, base64 string, URL, or null to use document.pdfUrl from config |
| config | Object | Configuration object (see below) |
| callback | Function | Event callback function |
PDF Data Examples:
// Use PDF from config
new WebSignPanel(null, config, callback);
// Use File from input
const file = input.files[0];
new WebSignPanel(file, config, callback);
// Use base64 string
const base64 = "JVBERi0xLjQK...";
new WebSignPanel(base64, config, callback);
// Use URL
new WebSignPanel("/path/to/document.pdf", config, callback);⚙️ Configuration Parameters
Settings Object
| Option | Type | Description |
|--------|------|-------------|
| bearerToken | string | Auth token for API communication |
| signatureEnvironment | string | "SANDBOX" or "PRO" |
| language | string | UI language ("es", "eu") |
| isLocked | boolean | Lock the panel (disable signing) |
| showCancelButton | boolean | Show cancel button |
| showFinishButton | boolean | Show finish/accept button |
| showSignPaperButton | boolean | Show print button |
| ebpPath | string | Path to EBP assets folder |
| authenticationUrl | string | Authentication service endpoint |
Document Object
| Option | Type | Description |
|--------|------|-------------|
| pdfUrl | string | URL or path to the PDF document |
| pdfB64 | string | Base64 encoded PDF (alternative to pdfUrl) |
Signer Object
| Option | Type | Description |
|--------|------|-------------|
| signerId | string | Unique identifier for the signer |
| label | string | Display name for the signer |
| isMandatory | boolean | Whether signature is required to complete |
| isSigned | boolean | Current signature status |
| timeStamp | string | Timestamp of signature |
| signatureType | string | "dtu", "stu", "display", "certificate", "auto" |
| signerListId | string | Group ID for organizing signers |
| autoSign | boolean | Automatically trigger signature on load |
| widget | Object | Signature positioning configuration |
| ebpText | Object | EBP template text values |
Widget Object
widget: {
type: "float", // "float" (text search) or "fixed" (coordinates)
text: "SIGN_HERE", // Text to search in PDF (for float type)
width: 160, // Signature area width
height: 100, // Signature area height
x: 100, // X position (for fixed type)
y: 100, // Y position (for fixed type)
page: 0, // PDF page number
gapX: 0, // Horizontal offset
gapY: 0, // Vertical offset
customText: [ // Text displayed on PDF after signing
{ text: "Digitally signed", fontSize: 6 },
{ text: "Date: ##TIMESTAMP##", fontSize: 4 }
]
}EBP Text Object
ebpText: {
Titulo: "Document Title",
AreaFirma: "Please sign below",
LOPD: "Privacy policy text...",
Texto1: "Additional text 1",
Texto2: "Additional text 2"
}EBP Assets (Wacom Devices)
If you use ebpText in your signers configuration, you must provide EBP template files for Wacom devices. Create a folder (default: /assets/ebp) with the following files:
/assets/ebp/
├── blackAndWhiteScreenSaver.png
├── colorScreenSaver.png
├── blackAndWhiteEbp.bin
├── colorEbp.bin
├── blackAndWhiteInitialEbp.bin
└── colorInitialEbp.binConfigure the path in settings:
settings: {
ebpPath: "/assets/ebp" // or your custom path
}Note: EBP assets are optional. If any files are missing, the signature will proceed without EBP templates and a warning will be logged to the console.
Signer Lists (Groups)
signerLists: [
{
listId: "GROUP-1",
label: "Main Signers",
isExpanded: true
},
{
listId: "GROUP-2",
label: "Optional Signers",
isExpanded: false
}
]📡 Callback Events
| Event | Description |
|-------|-------------|
| completed | All mandatory signatures done. event.data contains signed PDF, event.config contains updated config |
| cancel | User cancelled the process |
| error | An error occurred. event.error contains error message |
🧾 License
© 2026 Edatalia Data Solutions. All rights reserved.
WebSign Panel is proprietary software. See LICENSE.txt for details.
🏢 About
Developed by Edatalia, digital signatures and biometric solutions for secure document processing.
