PDFElement

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 PDFElement interface is the base of PDFFileElement and PDFPageElement: the properties both WebPDF elements share. It inherits properties and methods from HTMLElement. You never create one directly; the WebPDF module exports it for instanceof checks.

EventTargetNodeElementHTMLElementPDFElement

Instance properties

Also inherits properties from its parent interface, HTMLElement.

PDFElement.composed

A boolean value: whether the element's events cross shadow root boundaries. true by default.

PDFElement.controlsList

A DOMTokenList of the controls left out: parts of the bar and its menu, the bar, or the gestures. Reflects controlslist.

PDFElement.event

An object whose prefix reflects event:prefix: with "type", events are named pdf-file-load and so on.

PDFElement.placeholder

An object whose aspectRatio reflects placeholder:aspect-ratio: the box pages keep while their PDF is on the way.

PDFElement.toolbar

A string: the edge the bar sits on, "bottom" by default. Reflects toolbar.

Instance methods

Also inherits methods from its parent interface, HTMLElement.

None.

Examples

Checking for a WebPDF element

js
const { PDFElement } = await import("https://new.webpdf.pro/.js");
console.log(document.querySelector("pdf-page") instanceof PDFElement); // true

Specifications

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

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
PDFElement
1251251531111812515383182712518
composed
1251251531111812515383182712518
controlsList
1251251531111812515383182712518
event
1251251531111812515383182712518
placeholder
1251251531111812515383182712518
toolbar
1251251531111812515383182712518

Legend

Full support

See also