Skip to main content
Render PDFs in SuperDoc. The PDF viewer is configured through modules.pdf.

Install pdf.js

Install pdfjs-dist in your app:
Supported versions: >= 5.4.296.

Quick start

This is the recommended approach because the worker is configured once for the whole application.
Then disable auto-setup:

Configuration

Object
required
Preloaded pdf.js library instance
string
PDF.js worker source URL (falls back to CDN when omitted)
boolean
default:"false"
Whether to auto-configure pdf.js worker
boolean
default:"false"
Enable text layer rendering (for text selection)
number
default:"2"
Canvas render scale (quality)

Events

pdf:document-ready

Fired when all PDF pages are rendered.

Notes

  • outputScale affects render quality; zooming does not re-render the canvas.
  • If you need text selection, enable textLayer: true.