Skip to main content
Render PDFs in SuperDoc. PDF is a separate document type with its own rendering pipeline (pdf.js), distinct from the DOCX editor surface.
PDF rendering is configured through modules.pdf today, but it isn’t a built-in UI surface: it’s a viewer for a different file type.

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.