Skip to content
ComPDF
New Release

Open-Source PDF SDK & AI Document Processing

Get the full self-hosted SDK and AI document processing on GitHub. One-click deploy to quickly build your document workflows.

Signatures

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 PDF integration live in the closed-source Core engine. The UI layer drives them through the core bridge and mirrors signature state in the viewer and document stores.

UI APIs

Enable / disable the signature tool

javascript
UI.enableSignatureTool();     // useViewer.setDisableSignatureTool(false)
UI.disableSignatureTool();    // useViewer.setDisableSignatureTool(true)

Auto-jump

javascript
UI.setAutoJumpNextSign(true);   // useDocument.setAutoJumpNextSign(!!value)

When enabled, the viewer auto-jumps to the next signature field after one is signed.

Signature dialog configuration

javascript
UI.setSignatureDialogTabs(['keyboard', 'trackpad']);          // tabs shown in the dialog
UI.setEnableSignatureTemplates(true);                         // enable signature templates
UI.setSignatureDialogProperties('keyboard', { color: '#000000', lineWidth: 2 }, false);
APIStore actionPurpose
setSignatureDialogTabs(value)useViewer.setSignatureDialogTabsConfigure the tabs shown in the signature dialog.
setEnableSignatureTemplates(value)useViewer.setEnableSignatureTemplatesEnable/disable signature templates (the "mySignatures" list + create tabs).
setSignatureDialogProperties(type, properties, replace=false)useViewer.setSignatureDialogPropertiesSet properties (color, font, lineWidth) for a dialog type (KEYBOARD/TRACKPAD). replace replaces vs. merges.

Signature state (viewer store)

FieldPurpose
signatureDialogTabsTabs shown in the signature dialog.
signatureDialogPropertiesPer-tab properties (KEYBOARD/TRACKPAD colors, fonts, lineWidth).
enableSignatureTemplatesWhether templates are enabled.
disableSignatureToolWhether the signature tool is disabled.
digitalSignature{ preview, certSubject }.
selectedSignatureFieldThe currently selected signature field.
electronicSignaturesList / digitalSignaturesListSaved signature lists (persisted to localStorage).

The document store holds signatures[], selectedSignature, trustedCertificateLists[], pkcs12, disableDigitalSignature, disableElectronicSignature, autoJumpNextSign.

Signature components

  • SignCreatePanel.vue (components/Signatures/) — full-screen electronic signature creation/management panel. Two tabs when templates are enabled: "mySignatures" list and "create" (keyboard / trackpad / upload-image sub-tabs). Toggled via useViewer.isElementOpen(SIGN_CREATE_PANEL).
  • SignCreateDialog.vue — dialog variant of the signature creator, toggled via SIGNATURE_DIALOG.
  • DigitalSignCreatePanel.vue / DigitalKeyboardCreatePanel.vue — digital signature creation (certificate / keyboard input).
  • SignatureContainer.vue (components/SignatureContainer/) — left-panel signature tab content.
  • SignatureToolBar — sign-mode toolbar.

Related dialogs: SelectSignTypeDialog, SignatureAppearanceDialog, SignatureDetailsDialog, DeleteSignatureDialog, AddDigitalFileDialog, CertificationViewerDialog.

Core bridge (signature surface)

The core bridge exposes on instance.Core:

FunctionPurpose
handleSignApply a signature.
getSignature / deleteSignatureGet / delete a signature.
verifySignature / getVerificationResultVerify a signature.
loadCertificates / addToTrustedCertificateListsCertificate management.
checkCertificateIsTrustedTrust check.
setAutoJumpNextSignAuto-jump (engine side).

Examples

Enable the signature tool and auto-jump

javascript
UI.enableSignatureTool();
UI.setAutoJumpNextSign(true);

Configure the signature dialog

javascript
UI.setSignatureDialogTabs(['keyboard', 'trackpad', 'upload']);
UI.setSignatureDialogProperties('keyboard', { color: '#0000ff', lineWidth: 3 });
UI.setEnableSignatureTemplates(true);

Open the signature creation panel

javascript
UI.openElement('signCreatePanel');