PDFFileElement: max 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 max read-only property of the PDFFileElement interface returns an object with limits for a <pdf-file>. Its imageSize property reflects the max:image-size HTML attribute.

Value

An object with one property:

imageSize

A number of pixels: images larger than this (width × height) are not drawn. The default, -1, draws every image. Changing it loads the file again.

This is PDF.js's maxImageSize option: it protects pages from huge embedded images.

Examples

Skipping huge images

html
<pdf-file src=//pdf.ist/web.pdf max:image-size=16777216></pdf-file> <!-- 4096 × 4096 -->

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

Legend

Full support

See also