PDFPageElement: signature event

Works in all major browsers
Since July 2026

WebPDF works in Chrome and Edge 125, Firefox 153 and Safari 18, on desktop and mobile, and in every later version: the oldest versions its PDF.js build supports, which already have every platform feature WebPDF needs. Since July 2026, that is every major browser.

The signature event of the PDFPageElement interface fires when someone clicks a signature on a <pdf-page>: its hotspot or its compact card.

This event is cancelable and bubbles. It is also composed, so it crosses shadow root boundaries unless composed is false.

Syntax

Use the event name in methods like addEventListener(). WebPDF elements have no onsignature event handler property.

js
addEventListener("signature", (event) => { })

With event:prefix=type on the <script>, the file or the page, the event is named pdf-page-signature instead.

Event type

A CustomEvent. Inherits from Event.

EventCustomEvent

Event properties

This interface also inherits properties from its parent, Event.

detail

An object:

signatures

The rows of the signatures that hotspot or card stands for, as verify() returns them; see Signature verification results.

open

true when the full card is about to open, false when it is about to close.

Description

Call preventDefault() to keep the built-in card closed, for example to show the signature in your own interface instead.

Examples

Showing your own card

js
const page = document.querySelector("pdf-page");
page.addEventListener("signature", (event) => {
  event.preventDefault(); // no built-in card
  const [row] = event.detail.signatures;
  alert(`${row.status}: ${row.certificate?.subjectCN ?? row.signerName}`);
});

Specifications

Not part of any specification. <pdf-file> and <pdf-page> are autonomous custom elements defined by WebPDF.pro. It implements:

Specification
ISO 32000-2:2020 (PDF 2.0)
# 12.8 Digital signatures

Browser compatibility

desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
signature event
1251251531111812515383182712518

Legend

Full support

See also