pdftk-server by github/awesome-copilot
npx skills add https://github.com/github/awesome-copilot --skill pdftk-serverPDFtk Server 是一款用于处理 PDF 文档的命令行工具。它可以合并、拆分、旋转、加密、解密、添加水印、盖章、填充表单、提取元数据,并以多种方式操作 PDF。
winget install --id PDFLabs.PDFtk.Serverbrew install pdftk-javasudo apt-get install pdftksudo dnf install pdftk广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
pdftk --version 以验证安装pdftk file1.pdf file2.pdf cat output merged.pdf
使用句柄以获得更多控制:
pdftk A=file1.pdf B=file2.pdf cat A B output merged.pdf
pdftk input.pdf burst
提取第 1-5 页和第 10-15 页:
pdftk input.pdf cat 1-5 10-15 output extracted.pdf
移除第 13 页:
pdftk input.pdf cat 1-12 14-end output output.pdf
将所有页面顺时针旋转 90 度:
pdftk input.pdf cat 1-endeast output rotated.pdf
设置所有者密码和用户密码,使用 128 位加密(默认):
pdftk input.pdf output secured.pdf owner_pw mypassword user_pw userpass
使用已知密码移除加密:
pdftk secured.pdf input_pw mypassword output unsecured.pdf
使用 FDF 文件填充表单字段并扁平化以防止进一步编辑:
pdftk form.pdf fill_form data.fdf output filled.pdf flatten
将单页 PDF 置于输入文件的每一页之后(输入文件应具有透明度):
pdftk input.pdf background watermark.pdf output watermarked.pdf
将单页 PDF 置于输入文件的每一页之上:
pdftk input.pdf stamp overlay.pdf output stamped.pdf
导出书签、页面指标和文档信息:
pdftk input.pdf dump_data output metadata.txt
将损坏的 PDF 通过 pdftk 处理以尝试自动修复:
pdftk broken.pdf output fixed.pdf
交错合并单独扫描的偶数和奇数页:
pdftk A=even.pdf B=odd.pdf shuffle A B output collated.pdf
| 问题 | 解决方案 |
|---|---|
pdftk 命令未找到 | 验证安装;检查 pdftk 是否在系统 PATH 中 |
| 无法解密 PDF | 确保通过 input_pw 提供了正确的所有者或用户密码 |
| 输出文件为空或损坏 | 检查输入文件完整性;先尝试运行 pdftk input.pdf output repaired.pdf |
| 填充后表单字段不可见 | 使用 flatten 标志将字段合并到页面内容中 |
| 水印未出现 | 确保输入 PDF 具有透明区域;对于不透明的覆盖层使用 stamp |
| 权限被拒绝错误 | 检查输入和输出路径的文件权限 |
references/ 文件夹中的捆绑参考文档:
每周安装量
7.5K
代码仓库
GitHub 星标数
26.7K
首次出现
2026年2月16日
安全审计
安装于
codex7.4K
gemini-cli7.4K
opencode7.4K
github-copilot7.3K
cursor7.3K
kimi-cli7.3K
PDFtk Server is a command-line tool for working with PDF documents. It can merge, split, rotate, encrypt, decrypt, watermark, stamp, fill forms, extract metadata, and manipulate PDFs in a variety of ways.
winget install --id PDFLabs.PDFtk.Serverbrew install pdftk-javasudo apt-get install pdftksudo dnf install pdftkpdftk --versionpdftk file1.pdf file2.pdf cat output merged.pdf
Using handles for more control:
pdftk A=file1.pdf B=file2.pdf cat A B output merged.pdf
pdftk input.pdf burst
Extract pages 1-5 and 10-15:
pdftk input.pdf cat 1-5 10-15 output extracted.pdf
Remove page 13:
pdftk input.pdf cat 1-12 14-end output output.pdf
Rotate all pages 90 degrees clockwise:
pdftk input.pdf cat 1-endeast output rotated.pdf
Set an owner password and a user password with 128-bit encryption (default):
pdftk input.pdf output secured.pdf owner_pw mypassword user_pw userpass
Remove encryption using the known password:
pdftk secured.pdf input_pw mypassword output unsecured.pdf
Populate form fields from an FDF file and flatten to prevent further edits:
pdftk form.pdf fill_form data.fdf output filled.pdf flatten
Place a single-page PDF behind every page of the input (input should have transparency):
pdftk input.pdf background watermark.pdf output watermarked.pdf
Place a single-page PDF on top of every page of the input:
pdftk input.pdf stamp overlay.pdf output stamped.pdf
Export bookmarks, page metrics, and document information:
pdftk input.pdf dump_data output metadata.txt
Pass a broken PDF through pdftk to attempt automatic repair:
pdftk broken.pdf output fixed.pdf
Interleave separately scanned even and odd pages:
pdftk A=even.pdf B=odd.pdf shuffle A B output collated.pdf
| Issue | Solution |
|---|---|
pdftk command not found | Verify installation; check that pdftk is in your system PATH |
| Cannot decrypt PDF | Ensure you are providing the correct owner or user password via input_pw |
| Output file is empty or corrupt | Check input file integrity; try running pdftk input.pdf output repaired.pdf first |
| Form fields not visible after fill | Use the flatten flag to merge fields into the page content |
| Watermark not appearing | Ensure the input PDF has transparent regions; use stamp for opaque overlays |
| Permission denied errors | Check file permissions on input and output paths |
Bundled reference documents in the references/ folder:
Weekly Installs
7.5K
Repository
GitHub Stars
26.7K
First Seen
Feb 16, 2026
Security Audits
Gen Agent Trust HubWarnSocketPassSnykFail
Installed on
codex7.4K
gemini-cli7.4K
opencode7.4K
github-copilot7.3K
cursor7.3K
kimi-cli7.3K
97,600 周安装