@build-qube/papyra-tauri

中文文档
0.8.0发布于 2026/10/27MITTypeScriptES Module零依赖构建来源已验证近 30 天下载 4507

A Tauri engine for papyra's viewer: PDFs parsed and rendered in the app's host process by tauri-plugin-papyra

原始使用文档

@build-qube/papyra-tauri

Tauri engines for papyra's viewer and file preview: PDFs, TIFFs, spreadsheets, and Word and PowerPoint are parsed and rendered by papyra in the app's host process, through the tauri-plugin-papyra crate. TauriEngine is the PDF engine; openTiff and openWorkbook mirror papyra's own and resolve to its classes; and TauriOfficeEngine stands in for papyra's officeEngine.

A Tauri app's WebView is never cross-origin isolated on Android or iOS, so papyra's wasm build cannot run there. This engine does not need it: the Rust side renders on the device's real cores, and the WebView only paints.

Installing it, wiring tauri-plugin-papyra into the app, and keeping papyra's wasm out of the bundle are in the Tauri guide.

Pages and lifetimes

Pages travel over a papyra:// protocol, as PNG by default. new TauriEngine({ format: 'rgba' }) sends raw pixels instead: no encode or decode, four times the bytes. Which is faster depends on the device.

Documents stay in the host until closed — TIFFs and workbooks too, through their close(). The viewer's store and file preview close what they open; if you call the engine yourself, await engine.close(doc) — it rejects if the host could not release the document. When a WebView loads a page — a reload, HMR, the app restarting its UI — the host drops every document that WebView had open, since nothing on the new page could close them.

版本与发布记录

@build-qube/papyra-tauri 共发布 7 个版本,首次发布于 2026/10/22;过去 12 个月发布了 7 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.8.0latest2026/10/2713 天前
0.7.12026/10/2415 天前
0.7.02026/10/2416 天前
0.6.02026/10/2316 天前
0.5.02026/10/2317 天前
0.0.0-bootstrap.0bootstrap2026/10/2217 天前

关于 @build-qube/papyra-tauri 的常见问题

@build-qube/papyra-tauri 是什么?

A Tauri engine for papyra's viewer: PDFs parsed and rendered in the app's host process by tauri-plugin-papyra

如何安装 @build-qube/papyra-tauri?

在项目目录运行 npm install @build-qube/papyra-tauri,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@tauri-apps/api(^2.0.0)、@build-qube/papyra(^0.8.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@build-qube/papyra-tauri 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@build-qube/papyra-tauri 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@build-qube/papyra-tauri 可以商用吗?

@build-qube/papyra-tauri 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@build-qube/papyra-tauri 的下载量有多少?

根据 npm 官方下载统计,@build-qube/papyra-tauri 在 2026/10/09 – 2026/11/07 这 30 天内被下载 4,507 次,日均约 150 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@build-qube/papyra-tauri 还在维护吗?

最新版本 0.8.0 发布于 2026/10/27(13 天前);至今共发布 7 个版本,其中过去 12 个月发布了 7 个;首次发布于 2026/10/22。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。