PDF Generation Template Editor
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
The WebViewer supports both electronic signatures (drawn/typed/uploaded) and digital signatures (certificate-based). This guide covers the UI-side signature APIs and components.
Signature cryptography and the PDF integration belong to the Core. The UI drives them through
instance.Coreand keeps the saved signatures and the verification results in its stores.
The signature tools are the grouped items fillAndSignGroupedItems of the toolbar group toolbarGroup-FillAndSign:
UI.disableElements(['fillAndSignGroupedItems']);
UI.enableElements(['fillAndSignGroupedItems']);UI.enableFeatures([UI.Feature.AutoJumpNextSignature]);When enabled, the viewer jumps to the next signature field after one is signed.
UI.setSignatureDialogTabs(['keyboard', 'trackpad']); // tabs shown in the dialog
UI.enableFeatures([UI.Feature.SignatureTemplates]); // enable signature templates
UI.setSignatureDialogProperties('trackpad', { colors: ['#000000', '#FF0000'], lineWidth: 2 }, false);| API | Purpose |
|---|---|
setSignatureDialogTabs(tabs) | The tabs shown in the signature dialog and their order: 'keyboard', 'trackpad', 'image'. |
enableFeatures / disableFeatures([UI.Feature.SignatureTemplates]) | Enable/disable signature templates (saved signatures). |
setSignatureDialogProperties(type, properties, replace = false) | Set colors, enableCustomColor, fonts (keyboard only), enableLineWidth and lineWidth (trackpad only) for 'keyboard' or 'trackpad'. With replace the given properties replace the whole tab; otherwise they are merged. A font is a font name or { fontFamily, label, fontWeight }: label is the text on the preview card before anything is typed (the font name by default), and fontWeight (such as 700, default 400) is used to show and draw the signature. |
setMaxSignaturesCount(count) | The maximum number of saved signatures. |
setSignatureFonts(fonts) | The fonts of typed signatures. It also clears the label and fontWeight set with setSignatureDialogProperties. |
setSelectedTab('signatureModal', tab) | Select a tab: textSignaturePanelButton, inkSignaturePanelButton or imageSignaturePanelButton. |
| State | Purpose |
|---|---|
| Saved signatures / initials / digital signatures | Saved for the instance and restored next time. |
| Signature dialog tabs and properties | Set by the APIs above. |
| Verification results | Results of Document.verifySignatures(), shown in the signature panel. |
| Trusted certificates | Added with UI.VerificationOptions.addTrustedCertificates(certificates), or by the user with Trust in the certificate viewer (which fires UI.Events.TRUSTED_CERTIFICATE_ADDED). Files and bytes are read when added; URLs are kept and downloaded again at every verification (each document load and re-verification), and a URL that cannot be downloaded is skipped for that verification with a console error. The list is kept in memory only. |
signatureModal) — create an electronic signature by typing, drawing or uploading an image.digitalSignatureModal, signatureAppearanceModal) — choose a certificate and the appearance.signaturePanel, a tab of tabPanel) — the signatures of the document and their verification status.signatureDetailsModal, certificateViewerModal) — signer and certificate details.| API | Purpose |
|---|---|
documentViewer.getTool(Tools.ToolNames.SIGNATURE) | The electronic signature tool. |
UI.signSignatureWidget(widget, signature) | Sign a signature field. |
annotationManager.sign(...) | Apply a digital signature. |
documentViewer.getDocument().verifySignatures() | Verify the signatures of the document. |
See Digital Signatures.
UI.enableFeatures([UI.Feature.AutoJumpNextSignature]);
UI.setToolbarGroup('toolbarGroup-FillAndSign');UI.setSignatureDialogTabs(['keyboard', 'trackpad', 'image']);
UI.setSignatureDialogProperties('keyboard', { colors: ['#000000', '#2D7CF6'] }, false);
UI.setMaxSignaturesCount(5);UI.setSelectedTab('signatureModal', 'inkSignaturePanelButton');