Print

GitHubEdit on GitHub
Preset Info
@univerjs/preset-docs-advanced
Server Required
No

Print functionality allows users to print document content as physical documents or export it to PDF format for offline viewing and sharing.

Preset Mode

The print functionality is included in the @univerjs/preset-docs-advanced preset.

Installation

The UniverDocsAdvancedPreset preset from @univerjs/preset-docs-advanced depends on the UniverDocsDrawingPreset preset at runtime. Please install @univerjs/preset-docs-drawing first.

npm install @univerjs/preset-docs-drawing @univerjs/preset-docs-advanced

Usage

import { UniverDocsAdvancedPreset } from '@univerjs/preset-docs-advanced'
import UniverPresetDocsAdvancedEnUS from '@univerjs/preset-docs-advanced/locales/en-US'
import { UniverDocsCorePreset } from '@univerjs/preset-docs-core'
import UniverPresetDocsCoreEnUS from '@univerjs/preset-docs-core/locales/en-US'
import { UniverDocsDrawingPreset } from '@univerjs/preset-docs-drawing'
import UniverPresetDocsDrawingEnUS from '@univerjs/preset-docs-drawing/locales/en-US'
import { createUniver, LocaleType, merge } from '@univerjs/presets'

import '@univerjs/preset-docs-core/lib/index.css'
import '@univerjs/preset-docs-drawing/lib/index.css'
import '@univerjs/preset-docs-advanced/lib/index.css'

const { univerAPI } = createUniver({
  locale: LocaleType.EN_US,
  locales: {
    [LocaleType.EN_US]: merge(
      {},
      UniverPresetDocsCoreEnUS,
      UniverPresetDocsDrawingEnUS, 
      UniverPresetDocsAdvancedEnUS, 
    ),
  },
  presets: [
    UniverDocsCorePreset(),
    UniverDocsDrawingPreset(), 
    UniverDocsAdvancedPreset(), 
  ],
})

If you have a commercial license for Univer, please refer to Using License in Client for configuration.

Plugin Mode

Installation

npm install @univerjs-pro/docs-print

Usage

import { UniverDocsPrintPlugin } from '@univerjs-pro/docs-print'
import DocsPrintPluginEnUS from '@univerjs-pro/docs-print/locale/en-US'
import { LocaleType, merge, Univer } from '@univerjs/core'

import '@univerjs-pro/docs-print/lib/index.css'

const univer = new Univer({
  locale: LocaleType.EN_US,
  locales: {
    [LocaleType.EN_US]: merge(
      {},
      DocsPrintPluginEnUS, 
    ),
  },
})

univer.registerPlugin(UniverDocsPrintPlugin) 

If you have a commercial license for Univer, please refer to Using License in Client for configuration.