PDFPageElement

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 PDFPageElement interface provides properties and methods for showing a page of a PDF document with the <pdf-page> element. It inherits properties and methods from PDFElement and HTMLElement.

EventTargetNodeElementHTMLElementPDFElementPDFPageElement

Instance properties

Also inherits properties from its parent interface, PDFElement.

PDFPageElement.anno Read only

The annotation layer: links and form fields, with sync().

PDFPageElement.canvas

A string: the canvas engine, ".js" (PDF.js) or "ium" (PDFium). Reflects canvas.

PDFPageElement.controls

A boolean value: the page has viewer controls. Reflects controls.

PDFPageElement.file Read only

The PDFFileElement whose page this is, or null.

PDFPageElement.fullscreen Read only

A boolean value: the page is shown fullscreen.

PDFPageElement.image Read only

The image layer, with export() and metrics.

PDFPageElement.loading

A string: "eager" or "lazy". Reflects loading.

PDFPageElement.no

A number: the page number, negative from the end. Reflects no.

PDFPageElement.noUnclamped

A number: the page number as written, without clamping.

PDFPageElement.of

A string: the id of the file. Reflects of.

PDFPageElement.off Read only

A DOMTokenList of the parts the page leaves out. Reflects -.

PDFPageElement.offset Read only

An object whose x and y shift the content. Reflects offset:x and offset:y.

PDFPageElement.orientation Read only

A string: "portrait", "landscape" or "square".

PDFPageElement.rotation

A number: the rotation in degrees, a multiple of 90. Reflects rotation.

PDFPageElement.scale

A number: the zoom factor. Reflects scale.

PDFPageElement.signatures

A boolean value: the page shows its signature cards. Reflects signatures.

PDFPageElement.svg

A boolean value: the page is drawn as SVG. Reflects svg.

PDFPageElement.watermark

A string or null: a preview of the evaluation watermark on licensed domains. Reflects watermark.

Instance methods

Also inherits methods from its parent interface, PDFElement.

PDFPageElement.toggleFullscreen()

Shows the page fullscreen, or brings it back. Resolves to whether it worked.

PDFPageElement.update()

Draws the page again; resolves when done.

Events

Listen to these events using addEventListener(). WebPDF elements have no on… event handler properties.

error

The page cannot find its file, or its engine failed.

load

The page knows its size, before it draws.

render

The page has drawn.

signature

A signature on the page was clicked. Cancelable.

Examples

A page with a page counter

HTML

html
<pdf-file id=f src=//pdf.ist/web.pdf></pdf-file>
<p>Page <output id=no></output></p>
<pdf-page of=f id=page controls scale=0.4></pdf-page>

JavaScript

js
const page = document.querySelector("#page");
const out = document.querySelector("#no");
page.addEventListener("render", () => {
  out.value = `${page.no} of ${page.file.js.numPages}`;
});

Result

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
PDFPageElement
1251251531111812515383182712518
anno
1251251531111812515383182712518
canvas
1251251531111812515383182712518
controls
1251251531111812515383182712518
error event
1251251531111812515383182712518
file
1251251531111812515383182712518
fullscreen
12512515311118125153831827125No
image
1251251531111812515383182712518
load event
1251251531111812515383182712518
loading
1251251531111812515383182712518
no
1251251531111812515383182712518
noUnclamped
1251251531111812515383182712518
of
1251251531111812515383182712518
off
1251251531111812515383182712518
offset
1251251531111812515383182712518
orientation
1251251531111812515383182712518
render event
1251251531111812515383182712518
rotation
1251251531111812515383182712518
scale
1251251531111812515383182712518
signature event
1251251531111812515383182712518
signatures
1251251531111812515383182712518
svg
1251251531111812515383182712518
toggleFullscreen()
12512515311118125153831827125No
update()
1251251531111812515383182712518
watermark
1251251531111812515383182712518
  • fullscreen · Safari on iOS: Only available on iPad, not on iPhone: there, toggleFullscreen() resolves to false.
  • fullscreen · WebView on iOS: Not available: toggleFullscreen() resolves to false.
  • toggleFullscreen() · Safari on iOS: Only available on iPad, not on iPhone: there, toggleFullscreen() resolves to false.
  • toggleFullscreen() · WebView on iOS: Not available: toggleFullscreen() resolves to false.

Legend

Full support
Partial support
No support
See implementation notes.

See also