Installation & Basic Usage

Univer PDFs is part of the Univer Office SDK and does not provide a preset yet, so a PDF application is assembled in plugin mode.

Univer supports two integration modes: preset mode and plugin mode. Preset mode provides a preconfigured bundle of plugins, which reduces the amount of wiring. If you need deep customization or extensions, use plugin mode, where each plugin is selected and configured individually.

Setting up via plugin mode

Using package manager

The build tool must support ES Modules and the exports field in package.json.

Installation

Univer builds its UI with React and its data streams with RxJS, and it can also be embedded in a Vue or Angular application. Verify that the react, react-dom, and rxjs peer dependencies1 are installed. The Yarn command below adds them explicitly.

Keep all @univerjs/* and @univerjs-pro/* packages on the same version.

Shell
pnpm add @univerjs/core @univerjs/design @univerjs/ui @univerjs/docs-ui @univerjs-pro/license @univerjs-pro/pdfs @univerjs-pro/pdfs-ui

Keep every @univerjs/* and @univerjs-pro/* package on the same version.

Usage

Create the container with an explicit height before initializing Univer:

HTML
<div id="app" style="height: 600px"></div>

Import the facade entries used below before calling FUniver.newAPI(univer). Import @univerjs/design CSS first, then @univerjs/ui CSS, and product CSS last.

  1. Import the shared UI styles before the PDF UI style, and merge the locale packs that the application enables:

    TypeScript
    import { UniverLicensePlugin } from '@univerjs-pro/license'import { UniverPdfsPlugin } from '@univerjs-pro/pdfs'import { UniverPdfsUIPlugin } from '@univerjs-pro/pdfs-ui'import PdfsUIEnUS from '@univerjs-pro/pdfs-ui/locale/en-US'import { LocaleType, mergeLocales, Univer } from '@univerjs/core'import { FUniver } from '@univerjs/core/facade'import DesignEnUS from '@univerjs/design/locale/en-US'import { UniverDocsUIPlugin } from '@univerjs/docs-ui'import DocsUIEnUS from '@univerjs/docs-ui/locale/en-US'import { UniverUIPlugin } from '@univerjs/ui'import UIEnUS from '@univerjs/ui/locale/en-US'import '@univerjs/design/lib/index.css'import '@univerjs/ui/lib/index.css'import '@univerjs/docs-ui/lib/index.css'import '@univerjs-pro/pdfs-ui/lib/index.css'
  2. Import the PDF Facade2 entry. This side-effect import adds the PDF methods and enums to FUniver:

    TypeScript
    import '@univerjs-pro/pdfs/facade'
  3. Create the runtime, register the explicit plugin stack, and create a PDF:

    TypeScript
    const univer = new Univer({  locale: LocaleType.EN_US,  locales: {    [LocaleType.EN_US]: mergeLocales(      DesignEnUS,      UIEnUS,      DocsUIEnUS,      PdfsUIEnUS,    ),  },})univer.registerPlugin(UniverUIPlugin, { container: 'app' })univer.registerPlugin(UniverDocsUIPlugin)univer.registerPlugin(UniverLicensePlugin, {  license: process.env.CLIENT_LICENSE_TEXT,})univer.registerPlugin(UniverPdfsPlugin)univer.registerPlugin(UniverPdfsUIPlugin)const univerAPI = FUniver.newAPI(univer)univerAPI.createPdf({ name: 'Untitled PDF' })

Plugin configuration

UniverUIPlugin

  • container
    string | HTMLElement
    Mount element or its DOM ID.

UniverLicensePlugin

  • license
    string
    Client license file contents.

univer.registerPlugin and univer.registerPlugins methods

After the Univer instance is created, call univer.registerPlugin to register a plugin on it.

The call has the form univer.registerPlugin(Plugin, options). Plugin is the plugin to register, and options is an optional configuration object. Each plugin defines its own options.

To register several plugins at once, pass an array to univer.registerPlugins. This keeps plugin management in one place.

TypeScript
univer.registerPlugins([  [UniverUIPlugin, { container: 'app' }],  UniverDocsUIPlugin,  [UniverLicensePlugin, {    license: process.env.CLIENT_LICENSE_TEXT,  }],  UniverPdfsPlugin,  UniverPdfsUIPlugin,])

UniverPdfsUIPlugin depends on UniverDocsUIPlugin, so register the shared document UI plugin before it.

Mobile support

The mobile PDF UI is a separate export of the same package, UniverPdfsMobileUIPlugin. There is no mobile: true option and no PDF preset. Choose the UI mode before opening a PDF and replace the desktop UI registrations. Do not register both.

PackageDesktop registrationMobile registration
@univerjs/uiUniverUIPluginUniverMobileUIPlugin
@univerjs/docs-uiUniverDocsUIPluginUniverDocsMobileUIPlugin
@univerjs-pro/pdfs-uiUniverPdfsUIPluginUniverPdfsMobileUIPlugin
@univerjs-pro/pdfs-printUniverPdfsPrintPluginUniverPdfsMobilePrintPlugin
TypeScript
import { UniverDocsMobileUIPlugin } from '@univerjs/docs-ui'import { UniverPdfsMobileUIPlugin } from '@univerjs-pro/pdfs-ui'import { UniverPdfsMobilePrintPlugin } from '@univerjs-pro/pdfs-print'import { UniverMobileUIPlugin } from '@univerjs/ui'univer.registerPlugin(UniverMobileUIPlugin, { container: 'app' })univer.registerPlugin(UniverDocsMobileUIPlugin, { footer: false })univer.registerPlugin(UniverPdfsMobileUIPlugin)// Optional: add Print to the mobile viewer menu.univer.registerPlugin(UniverPdfsMobilePrintPlugin)

UniverPdfsMobileUIPlugin declares UniverMobileUIPlugin and UniverDocsMobileUIPlugin as dependencies, so register them first. It opens on the page-preview grid instead of the desktop thumbnail rail. The host application decides when to mount this stack, for example by viewport width. A narrow container around the desktop plugin does not produce the mobile UI. See Print for the mobile print plugin.

Optional thumbnail worker

Page thumbnails render on the main thread without additional configuration. For larger documents, pass them to a dedicated module worker through thumbnailWorkerURL.

Create a worker entry such as pdf-thumbnail.worker.ts:

TypeScript
import { UniverPdfsUIWorkerPlugin } from '@univerjs-pro/pdfs-ui/worker'import { Univer } from '@univerjs/core'const univer = new Univer()univer.registerPlugin(UniverPdfsUIWorkerPlugin)

Pass the worker URL when registering the PDF UI plugin:

UniverPdfsUIPlugin

  • thumbnailWorkerURL
    string | URL | Worker
    Generate page thumbnails in a browser Worker.
TypeScript
univer.registerPlugin(UniverPdfsUIPlugin, {  thumbnailWorkerURL: new Worker(new URL('./pdf-thumbnail.worker.ts', import.meta.url), { type: 'module' }),})

The option also accepts a string URL or an existing Worker. If workers or OffscreenCanvas are unavailable, thumbnail rendering falls back to the main thread.

Collaboration-backed editing

@univerjs-pro/pdfs-editor is not part of a local-only stack, and it cannot function independently. Install and register the complete @univerjs-pro/collaboration, @univerjs-pro/collaboration-client, and @univerjs-pro/collaboration-client-ui stack as described in Collaboration, then install and register the PDF editor lifecycle plugin.

Node.js usage

A Node.js service can register UniverPdfsPlugin without any browser UI package. Add the collaboration stack above only when the service needs to load or synchronize persisted PDF units.

Other releases

Besides stable releases, Univer maintains alpha and beta channels that provide access to features which are not officially released yet. More features also mean more risk: these versions may contain bugs, incomplete functionality, or unstable features, so avoid them in production where possible.

Alpha / beta release

When the Univer team completes a new feature or a significant change, it may pre-release the change to the alpha or beta channel. Install an alpha or beta version of a package with:

Shell
pnpm add @univerjs-pro/pdfs@alpha # Alpha version
pnpm add @univerjs-pro/pdfs@beta # Beta version

If a problem occurs or you have feedback while using an alpha or beta version, report it to the Univer team through GitHub Issues. Feedback on these early releases is welcome.

Next steps

Footnotes

  1. peerDependencies declare dependencies that the host application must provide with compatible versions. They let Univer share libraries such as React instead of bundling a separate copy. ↩

  2. Facade is the application-facing API over registered plugins. Importing a Facade entry adds API methods; it does not register the feature plugin itself. ↩

How is this guide?

© 2026 DreamNum Co., Ltd.