PDFPageElement: controls property

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 controls property of the PDFPageElement interface sets or returns whether a <pdf-page> has viewer controls, like controls on <video>: keys, a bar and touch gestures. It reflects the controls HTML attribute.

Value

A boolean value: the effective one, also when the page inherits it.

The attribute is multi-homed: when the page has none, it follows its <pdf-file>, then the WebPDF <script>. Reading the property gives the effective value, its own or inherited.

Setting false writes controls=-, which turns the controls off even when the file or the <script> has them; setting null removes the attribute, so the page inherits again. The getter is false whenever -=controls (see off) applies anywhere up the chain.

A page with controls can be focused (click it or press Tab) and then takes keys; it shows a bar when the mouse is over it or when you tap it, and it turns pages on a swipe. PDFElement.toolbar places its bar, and PDFElement.controlsList chooses which of these it gets.

Examples

A viewer in one element

Click the page, then try ← →, Q E or F, or hover it for the bar.

HTML

html
<pdf-file id=f src=//pdf.ist/web.pdf></pdf-file>
<pdf-page of=f controls scale=0.5></pdf-page>

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
controls
1251251531111812515383182712518

Legend

Full support

See also