
PDFtk Server
OfficialFreeCommand-line tool for comprehensive PDF manipulation.
Free · Opens the source repo
What PDFtk Server does
PDFtk Server is a versatile command-line tool designed for manipulating PDF documents efficiently. It provides a wide array of functionalities, including merging multiple PDFs, splitting them into individual pages, rotating pages, and encrypting or decrypting files. This skill is particularly useful for developers and designers who require a reliable way to handle PDF documents directly from the command line, allowing for automation and integration into scripts or larger workflows.
The tool supports various operations such as filling PDF forms using FDF/XFDF data, applying watermarks, and extracting metadata. Users can also repair corrupted PDFs and manage embedded files within PDFs. With a straightforward command syntax, PDFtk Server makes it easy to perform complex PDF manipulations without the need for a graphical user interface, which can be a significant advantage in server environments or for batch processing tasks.
PDFtk Server is ideal for those who frequently work with PDF files and need a quick, scriptable solution for document management. Whether you are a developer looking to integrate PDF functionalities into your applications or a designer needing to automate repetitive PDF tasks, this skill provides the necessary tools to enhance your productivity and streamline your workflows.
When to use it
Use this skill when you need to automate PDF tasks such as merging, splitting, or encrypting documents directly from the command line.
When not to use it
This skill may not be suitable for users who prefer a graphical interface or require advanced PDF editing features that are not supported by command-line tools.
What you can build with it
Merging PDF Documents
Combine multiple PDF files into a single document using a simple command, streamlining document management.
Automating Form Filling
Fill PDF forms automatically from FDF data, which is useful for generating personalized documents in bulk.
Repairing Corrupted PDFs
Attempt to fix corrupted PDF files by passing them through PDFtk, which can restore usability.
How to install PDFtk Server
View source1. Install with the skills CLI
npx skills add github/awesome-copilot/pdftk-server --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by githubPDFtk Server
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.
When to Use This Skill
- Merging or joining multiple PDF files into one
- Splitting or bursting a PDF into individual pages
- Rotating PDF pages
- Encrypting or decrypting PDF files
- Filling PDF form fields from FDF/XFDF data
- Applying background watermarks or foreground stamps
- Extracting PDF metadata, bookmarks, or form field information
- Repairing corrupted PDF files
- Attaching or extracting files embedded in PDFs
- Removing specific pages from a PDF
- Collating separately scanned even/odd pages
- Compressing or decompressing PDF page streams
Prerequisites
- PDFtk Server must be installed on the system
- Windows:
winget install --id PDFLabs.PDFtk.Server - macOS:
brew install pdftk-java - Linux (Debian/Ubuntu):
sudo apt-get install pdftk - Linux (Red Hat/Fedora):
sudo dnf install pdftk
- Windows:
- Access to a terminal or command prompt
- Verify installation by running
pdftk --version
Step-by-Step Workflows
Merge Multiple PDFs
pdftk 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
Split a PDF into Individual Pages
pdftk input.pdf burst
Extract Specific Pages
Extract pages 1-5 and 10-15:
pdftk input.pdf cat 1-5 10-15 output extracted.pdf
Remove Specific Pages
Remove page 13:
pdftk input.pdf cat 1-12 14-end output output.pdf
Rotate Pages
Rotate all pages 90 degrees clockwise:
pdftk input.pdf cat 1-endeast output rotated.pdf
Encrypt a 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
Decrypt a PDF
Remove encryption using the known password:
pdftk secured.pdf input_pw mypassword output unsecured.pdf
Fill a PDF Form
Populate form fields from an FDF file and flatten to prevent further edits:
pdftk form.pdf fill_form data.fdf output filled.pdf flatten
Apply a Background Watermark
Place a single-page PDF behind every page of the input (input should have transparency):
pdftk input.pdf background watermark.pdf output watermarked.pdf
Stamp an Overlay
Place a single-page PDF on top of every page of the input:
pdftk input.pdf stamp overlay.pdf output stamped.pdf
Extract Metadata
Export bookmarks, page metrics, and document information:
pdftk input.pdf dump_data output metadata.txt
Repair a Corrupted PDF
Pass a broken PDF through pdftk to attempt automatic repair:
pdftk broken.pdf output fixed.pdf
Collate Scanned Pages
Interleave separately scanned even and odd pages:
pdftk A=even.pdf B=odd.pdf shuffle A B output collated.pdf
Troubleshooting
| 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 |
References
Bundled reference documents in the references/ folder:
- pdftk-man-page.md - Complete manual reference with all operations, options, and syntax
- pdftk-cli-examples.md - Practical command-line examples for common tasks
- download.md - Installation and download instructions for all platforms
- pdftk-server-license.md - PDFtk Server licensing information
- third-party-materials.md - Third-party library licenses
Frequently asked questions about PDFtk Server
Similar skills
PDF Processing
Comprehensive tools for manipulating PDF files.
PDF Processing
Comprehensive tools for managing PDF files.
Mac Storage Cleaner
Reclaim disk space safely and transparently on macOS.
PDF Processing
Comprehensive tools for managing PDF files.
Screenshot Capture
Capture screenshots across different platforms easily.
PDF Skill
Efficiently manage and manipulate PDF documents.
