API 参考

@univerjs-pro/pdfs-exchange-client

本 API 页面目前提供英文正文。代码签名与标识符不随界面语言变化。

PDF import and export client integration for Web SDK.

TypeScript
import { UniverPdfsExchangeClientPlugin } from '@univerjs-pro/pdfs-exchange-client'univer.registerPlugin(UniverPdfsExchangeClientPlugin)

The root entry exports IPdfExchangeService for custom integrations. The plugin currently has no configurable options.

Entry points

  • Facade: @univerjs-pro/pdfs-exchange-client/facade

Facade API

TypeScript
import '@univerjs-pro/pdfs-exchange-client/facade'importPdfToUnitIdAsync(file: File | string): Promise<string | undefined>importPdfToSnapshotAsync(file: File | string): Promise<IPdfUnitData | undefined>appendPdfAsync(file: File | string, unitId?: string): Promise<boolean>exportPdfAsync(unitId?: string): Promise<File | undefined>exportPdfByUnitIdAsync(unitId: string): Promise<File | undefined>exportPdfBySnapshotAsync(snapshot: IPdfUnitData): Promise<File | undefined>transformSnapshotJsonToPdfDataAsync(json: ISnapshotBlockJsonResponse): Promise<IPdfUnitData>transformPdfDataToSnapshotJsonAsync(pdfData: IPdfUnitData): Promise<ISnapshotBlockJson>

appendPdfAsync appends pages to an open PDF. exportPdfAsync commits the active text edit before exporting and returns undefined if the edit cannot be committed. Both methods use the active PDF when unitId is omitted.

Import @univerjs-pro/exchange-client/facade as well when using the shared downloadFile(file, filename, fileExt) helper. See PDF import and export for the complete workflow.

你觉得这篇文档如何?

© 2026 DreamNum Co., Ltd.