PDFPageElement: svg 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 svg property of the PDFPageElement interface sets or returns whether a <pdf-page> is drawn as vector SVG instead of on a canvas. It reflects the svg HTML attribute.

Value

A boolean value. The default is false.

An svg page is real vector SVG, built from PDF.js's drawing operations in a background worker, so it stays sharp at any zoom, and it is exported and copied as image/svg+xml. It wins over canvas.

If the SVG module cannot load, the page is drawn on a canvas and matches :state(svg-fallback). With controls, V switches to SVG and Alt V toggles it.

Examples

Drawing a page as SVG

An SVG page keeps its edges sharp when the browser zooms in.

HTML

html
<pdf-file id=f src=//pdf.ist/web.pdf></pdf-file>
<pdf-page of=f svg scale=0.4></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
svg
1251251531111812515383182712518

Legend

Full support

See also