@ai-ecoverse/wasm-qpdf

中文文档
12.4.2-10发布于 2026/10/26Apache-2.0零依赖构建来源已验证近 30 天下载 2109

qpdf 12.4: inspect, merge, split, rotate, encrypt, decrypt and linearize PDF files.

原始使用文档
文档目录4 节
  1. 12.4.2-6: fix-qdf is a helper; no pkg-config at configure (…
  2. 12.4.2-8: checked for reproducible builds (homescoop#1354, …
  3. 12.4.2-9: reproducible qpdf.wasm (homescoop#1354; 2026-10-2…
  4. 12.4.2-10: licence notices (homescoop#1750; 2026-10-23)

@ai-ecoverse/wasm-qpdf

qpdf 12.4.2 for slicc's wasm realm: qpdf, fix-qdf and zlib-flate. It replaces slicc 6's pdftk.

pnpm add -g @ai-ecoverse/wasm-qpdf
qpdf --empty --pages a.pdf b.pdf -- merged.pdf    # pdftk cat
qpdf --split-pages in.pdf page-%d.pdf             # pdftk burst
qpdf --rotate=+90:1 in.pdf out.pdf                # pdftk rotate
qpdf --json in.pdf                                # pdftk dump_data
qpdf --password=secret --decrypt in.pdf out.pdf
qpdf --linearize in.pdf web.pdf
qpdf --check in.pdf

For text extraction use pdftotext from @ai-ecoverse/wasm-poppler.

Built with qpdf's native crypto provider (no OpenSSL or GnuTLS), and with zlib and libjpeg-turbo from homescoop.

12.4.2-6: fix-qdf is a helper; no pkg-config at configure (homescoop#1354; 2026-10-20)

fix-qdf has "helper": true in slicc.commands, as the KC ruled. It still runs as before; listings that hide helpers leave it out. The description is now one plain sentence. The build configures with no pkg-config, so a zlib port in the emsdk cache can't replace @ai-ecoverse/wasm-zlib. The bytes are the same.

qpdf.wasm can still come out in one of two 14-byte variants. That comes from emsdk 4.0.23's LLVM: its WebAssembly CFG Stackify pass iterates a pointer-keyed map, and the nesting of one try/delegate pair varies. Both variants behave the same. The fix arrives with an emsdk at or after 6.0.2 (llvm-project#205184). See cert/NEGATIVE.md.

12.4.2-8: checked for reproducible builds (homescoop#1354, #808, #918; 2026-10-22)

homescoop's CI now builds qpdf twice and compares the two packages. The build stops unless qpdf, fix-qdf and zlib-flate link the zlib and libjpeg-turbo from homescoop, with no pkg-config module. New cert specs cover pages copied between files (cert/foreign.mjs) and the package's command list (cert/manifest.mjs). The tools behave as in 12.4.2-7.

12.4.2-9: reproducible qpdf.wasm (homescoop#1354; 2026-10-23)

qpdf now builds with the patched Emscripten 6.0.9 tree (scripts/emscripten-tree.sh, the toolchain cmake, wasm-binaryen and wasm-clang use) instead of emsdk 4.0.23. emsdk 4.0.23's LLVM nested one try/delegate pair in qpdf.wasm by heap address, so two builds of the same inputs could differ by 14 bytes. emsdk 6.0.9's LLVM has the fix (llvm-project fd76c9bdf103, in emsdk 6.0.2 and later), and every build now gives the same bytes. The tools behave as in 12.4.2-8: the same qpdf, the same zlib and libjpeg-turbo, the same slicc shims, and still Wasm exceptions in their legacy encoding. The Emscripten runtime in the glue is now 6.0.9, with the 4.0.23 build's FS.lookupPath symlink fix (wasm-emscripten's 0014-libfs-symloop.patch) applied on top.

12.4.2-10: licence notices (homescoop#1750; 2026-10-23)

The package now ships qpdf's NOTICE.md, which 12.4.2-8 and 12.4.2-9 left out. It credits the SHA-2 code qpdf includes from sphlib 3.0 (Projet RNRT SAPHIR, MIT licence) and the public-domain Rijndael code. THIRD-PARTY-NOTICES.md now also carries the sphlib notice from libqpdf/sha2.c and the RSA Data Security MD5 notice from libqpdf/MD5_native.cc. The tools are unchanged.

版本与发布记录

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

版本发布日期距今
12.4.2-10latest2026/10/2613 天前
12.4.2-92026/10/2315 天前
12.4.2-82026/10/2216 天前
12.4.2-72026/10/2217 天前
12.4.2-62026/10/2117 天前
12.4.2-52026/10/2018 天前

关于 @ai-ecoverse/wasm-qpdf 的常见问题

@ai-ecoverse/wasm-qpdf 是什么?

qpdf 12.4: inspect, merge, split, rotate, encrypt, decrypt and linearize PDF files.

如何安装 @ai-ecoverse/wasm-qpdf?

在项目目录运行 npm install @ai-ecoverse/wasm-qpdf,或使用 pnpm add / yarn add / bun add。

@ai-ecoverse/wasm-qpdf 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/ai-ecoverse__wasm-qpdf 是否存在。

@ai-ecoverse/wasm-qpdf 可以商用吗?

@ai-ecoverse/wasm-qpdf 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@ai-ecoverse/wasm-qpdf 的下载量有多少?

根据 npm 官方下载统计,@ai-ecoverse/wasm-qpdf 在 2026/10/05 – 2026/11/03 这 30 天内被下载 2,109 次,日均约 70 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@ai-ecoverse/wasm-qpdf 还在维护吗?

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