@condorhero/merge-pdfs

中文文档
0.0.7发布于 2023/07/04MITTypeScriptESM + CJS近 30 天下载 1.5万

Merging PDF (with Outline).

原始使用文档
文档目录4 节
  1. motive
  2. Installation
  3. Usage
  4. License

@condorhero/merge-pdfs

NPM version NPM Downloads GitHub stars LICENSE

Merging PDF (with Outline).

Node.js > 18.5.0.Technical support provided by pypdf.

motive

In the Javascript world, when merging multiple PDFs with outlines, the outline will be automatically lost. Neither pdf-lib nor pdfjs solve this problem, and even the PDFCPU that processes PDFs in the GO language world does not support this feature. The reason is that the outline and page are not within the same object of the PDF specification, making copying the outline more complex. However, this feature can be achieved, such as pypdf in the Python language world.

Installation

npm install -D @condorhero/merge-pdfs

Usage

# The default export file name is merged-pdf.pdf
merge-pdfs 1.pdf 2.pdf

# Customize to Export File Name
merge-pdfs 1.pdf 2.pdf -o custom.pdf

# glob: merge some pdf
merge-pdfs pdf/*.pdf -o merged-pdf.pdf

License

MIT

版本与发布记录

@condorhero/merge-pdfs 共发布 7 个版本,首次发布于 2023/04/24;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.0.7latest2023/07/043 年前
0.0.62023/05/103 年前
0.0.52023/05/093 年前
0.0.42023/05/093 年前
0.0.32023/04/273 年前
0.0.22023/04/253 年前

关于 @condorhero/merge-pdfs 的常见问题

@condorhero/merge-pdfs 是什么?

Merging PDF (with Outline).

如何安装 @condorhero/merge-pdfs?

在项目目录运行 npm install @condorhero/merge-pdfs,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 merge-pdfs,可以用 npx merge-pdfs 直接运行。

@condorhero/merge-pdfs 支持 TypeScript 吗?

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

@condorhero/merge-pdfs 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@condorhero/merge-pdfs 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18.5.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@condorhero/merge-pdfs 可以商用吗?

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

@condorhero/merge-pdfs 的下载量有多少?

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

@condorhero/merge-pdfs 还在维护吗?

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