Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Merges, splits, extracts text from, and reports info for local PDF files via command line.
Use this skill ↓36% 5%−32 ptsof test cases passed
Passed 1 of 22 test cases with the skill, and 8 of 22 without it.
3 of 3 safety checks passed
1 agent run
1 forkA fork is a copy of this skill that someone made so they could edit it for their own use. The original doesn't change.
帮用户对本地 PDF 文件做常见处理:合并、拆分、提取文字、转图片。优先用系统已有工具,
没有就用 Python 的 pypdf(轻量纯 Python,必要时 pip install pypdf 自动安装)。
用 Bash 工具执行。下面以 pypdf 为例(跨平台、无需 Office/Acrobat):
# 确保依赖(仅首次,已装会秒过)
python -c "import pypdf" 2>/dev/null || pip install -q pypdf
# 合并 a.pdf b.pdf -> merged.pdf
python - <<'PY'
from pypdf import PdfWriter
w = PdfWriter()
for f in ["a.pdf", "b.pdf"]:
w.append(f)
w.write("merged.pdf"); w.close()
print("已合并 -> merged.pdf")
PY
# 提取全部文字
python - <<'PY'
from pypdf import PdfReader
r = PdfReader("input.pdf")
print("\n".join((p.extract_text() or "") for p in r.pages))
PY
# 抽取第 1-3 页 -> sub.pdf
python - <<'PY'
from pypdf import PdfReader, PdfWriter
Next to this one in the catalogue, plus more from the same author.