pdf-batch-print

A Windows tool for batch printing local PDF files. Used to print multiple PDFs at once, specify printer and copy count, choose page ranges and single-/double-sided printing, set paper size and scaling; supports merging multiple PDFs into one and previewing pages before printing. Common trigger phrases include “batch print PDF,” “print these invoices to a specific printer,” “print pages 1–3 of this PDF,” “merge these files then print,” “preview before printing,” “print on A4,” and “print PDFs in a folder.”

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "pdf-batch-print" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-690059978b52741c49a856edd729b2faa55de1c5a13413e6dec0ec3fae8495cd. Verify the upstream source and version against https://skillhub.cn/skills/user_5a90548c/pdf-batch-print-tool before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

A Windows tool for batch printing local PDF files. Used to print multiple PDFs at once, specify printer and copy count, choose page ranges and single-/double-sided printing, set paper size and scaling; supports merging multiple PDFs into one and previewing pages before printing. Common trigger phrases include “batch print PDF,” “print these invoices to a specific printer,” “print pages 1–3 of this PDF,” “merge these files then print,” “preview before printing,” “print on A4,” and “print PDFs in a folder.”

0 Downloads

Introduction source: third_party · user_5a90548c · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Audience
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: pdf-batch-print
slug: pdf-batch-print
version: 1.0.0
category: productivity
platforms:
  - WorkBuddy
  - Claude Desktop
  - Cursor
description: 在 Windows 上批量打印本地 PDF 文件。当用户需要一次性打印多个 PDF、指定打印机/份数/页码范围/单双面/纸张大小/缩放方式、在打印前将多个 PDF 合并成一个、或打印前预览页面时使用本技能。触发词包括:「批量打印PDF」「把这些发票打到某打印机」「打印这个PDF的第1-3页」「合并这些文件再打印」「打印前先预览」「A4纸打印」「打印文件夹里的PDF」。
triggers:
  - 批量打印PDF
  - 打印PDF
  - A4纸打印
  - 双面打印
  - 合并打印
  - 打印文件夹里的PDF
agent_created: true

PDF 批量打印 (pdf-batch-print)

Overview

Windows 本地 PDF 批量打印,基于 SumatraPDF 实现精确的打印机/份数/页码/双面/方向/纸张/缩放控制。用户只需在对话中说出需求,AI 自动执行——不需要命令行,不需要手动操作。

When to Use

用户在 WorkBuddy 对话中提到打印 PDF 的任何意图时,立即加载本技能。触发词:

  • 「打印 / 批量打印 / 合并打印」
  • 「用A4纸打印」「打到HP打印机」「双面打印」「横向打印」
  • 「打印第1-3页」「打印前先预览」
  • 用户在对话中 @引用 了 PDF 文件并暗示要打印

推荐用法(WorkBuddy 对话模式 — 用户零操作)

用户只需说一句话,AI 全权代劳,不需要碰命令行。

示例对话: | 用户说 | AI 自动做什么 | |---|---| | "用A4纸打印这几个文件" | 枚举打印机 → 检查PDF尺寸 → 调用CLI打印 → 报告结果 | | "打印 510001.pdf" | 单文件打印到默认打印机 | | "双面打印这些发票,3份" | 加 --duplex 长边双面 --copies 3 | | "打第1-5页到HP打印机" | 加 --pages 1-5 --printer "HP..." | | "合并后再打印" | 加 --merge | | "打印文件夹 D:\合同 里所有PDF" | 加 --folder |

AI 执行步骤(自动完成,用户不需参与):

  1. 加载本技能(Skill 工具)
  2. 定位脚本路径:本技能安装后,脚本位于 ~/.workbuddy/skills/pdf-batch-print/scripts/pdf_batch_print.py。AI 应通过以下方式获取确切路径:
    • 优先使用 Glob 搜索 **/.workbuddy/skills/pdf-batch-print/scripts/pdf_batch_print.py
    • 或拼接 HOME_DIR/.workbuddy/skills/pdf-batch-print/scripts/pdf_batch_print.py
  3. 用脚本函数检测打印机:list_printers() / default_printer()
  4. 检查 PDF 页面尺寸(用 pypdf),判断是否需要缩放
  5. 检查/下载 SumatraPDF 后端:ensure_sumatra()
  6. 组装 CLI 命令并执行(Bash 工具)
  7. 向用户报告打印结果

AI 调用 CLI 的标准命令格式:

cd "<SKILL_DIR>/scripts" && python pdf_batch_print.py --cli --printer "打印机名" --paper A4 --fit shrink --files 文件1.pdf 文件2.pdf

其中 <SKILL_DIR> 是本技能的安装根目录(通常为 ~/.workbuddy/skills/pdf-batch-print)。Python 使用 WorkBuddy 管理的版本(如 ~/.workbuddy/binaries/python/versions/3.13.12/python.exe)或系统 Python。

可用参数: | 参数 | 说明 | 示例 | |---|---|---| | --files | 一个或多个 PDF 文件路径 | --files a.pdf b.pdf | | --folder | 包含 PDF 的文件夹(递归扫描) | --folder "D:\合同" | | --printer | 目标打印机名称(默认=系统默认) | --printer "HP LaserJet" | | --copies | 打印份数(默认 1) | --copies 3 | | --pages | 页码范围,如 1-3,5 | --pages 1-3,5 | | --duplex | 双面:none / 长边双面 / 短边双面 | --duplex 长边双面 | | --orient | 方向:纵向 / 横向 | --orient 横向 | | --paper | 纸张大小:A4 / A3 / letter / legal | --paper A4 | | --fit | 缩放:fit / shrink / noscale | --fit shrink | | --merge | 先合并所有 PDF 再打印 | --merge | | --cli | 强制命令行模式 | --cli |

不指定 --printer 则自动用系统默认打印机;不指定 --paper 则用打印机默认纸张。

其他用法(备选)

GUI 模式(适合想手动操作的用户)

  1. 进入 scripts/ 目录,运行 python pdf_batch_print.py(无参数)启动图形界面。
  2. 首次运行会自动安装所需依赖(pypdf、pypdfium2、Pillow)并下载 SumatraPDF 后端。
  3. 添加文件 → 设置参数 → 打印。

命令行模式(适合定时任务/脚本集成)

cd scripts && python pdf_batch_print.py --cli --files a.pdf b.pdf --printer "HP" --paper A4 --copies 2

别人下载后能直接用吗?

WorkBuddy 对话模式:零配置,直接说就行。 AI 自动处理所有技术细节(下载后端、枚举打印机、组装命令)。

CLI 模式:几乎零配置。 纯打印不需要任何 pip 包(SumatraPDF 完成渲染和打印控制)。首次运行自动下载 SumatraPDF 便携版到 scripts/tools/。

GUI 模式:需 Python 3.12(带 tkinter)+ 联网。

唯一前提:首次需联网。 SumatraPDF 便携版约 5.5MB,三层兜底下载(urllib → curl → PowerShell),成功率极高。离线环境需手动指定本机已装的 SumatraPDF.exe。

Important Notes

  • 打印后端是 SumatraPDF:精确控制打印。缺失时三层兜底自动下载,脚本明确警告而非静默退化到"只打开不打印"。
  • 打印机枚举四层兜底:PowerShell → win32print → winspool ctypes → SumatraPDF -list-printers,确保任何 Windows 环境都能识别打印机。
  • 纸张与缩放:--paper 映射到 SumatraPDF paper= 设置;--fit 映射到 fit/shrink/noscale。某些驱动需精确纸张名如 paper="A3 297 x 420 mm"。
  • 纯打印无需 pip 包:SumatraPDF 完成渲染和打印控制;pypdf 仅用于合并和页数统计(GUI/合并模式才需要)。
  • 脚本路径自定位:所有路径基于 os.path.dirname(os.path.abspath(__file__)),无论 skill 安装在哪都能正确工作。

Troubleshooting

  • 「未找到 SumatraPDF」:联网后重试,自动下载;或 GUI 点「配置 SumatraPDF」手动指定本机已装版本。
  • 打印后只打开文件没输出:说明走了系统回退,必须配置 SumatraPDF。
  • paper=A4 无效:部分驱动命名不同,用精确名如 paper="A3 297 x 420 mm"。
  • 打印机列表为空:沙箱环境可能阻止 PowerShell,脚本会自动用 winspool ctypes 兜底。

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 解决 Windows 上 PDF 批量打印的实际痛点
  • 支持多参数精确控制(打印机/份数/页码/双面/纸张/缩放)
  • 适用于办公文档打印高频场景
Trigger Precision90/100

Highlights

  • 触发词覆盖全面且边界清晰
  • description 位置正确,frontmatter 完整
Structure and Standards90/100

Highlights

  • 结构清晰,Phase/步骤分明
  • 包含端到端示例对话
  • frontmatter 完整,文档规范
Execution Reliability85/100

Highlights

  • 工具来源明确(SumatraPDF 后端)
  • 三层兜底下载机制确保可靠性
  • 打印机枚举四层兜底,覆盖主要异常
Evidence Verifiability (mean of the first four)88/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.