pdftk Server

Skill for using the command-line tool pdftk (PDFtk Server) for working with PDF files. Use when asked to merge PDFs, split PDFs, rotate pages, encrypt or dec...

MIT-0 · Free to use, modify, and redistribute. No attribution required.
0 · 456 · 2 current installs · 2 all-time installs
byJohn Haugabook@jhauga
MIT-0
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
The name/description promise PDF manipulation via PDFtk Server and the SKILL.md contains only pdftk usage, examples, and platform package-manager install suggestions — all directly relevant. No unrelated binaries, env vars, or network endpoints are requested.
Instruction Scope
Instructions are narrowly scoped to running pdftk on local files (merge, split, encrypt, stamp, etc.). A security note: many examples show passwords provided on the command line (owner_pw, user_pw, input_pw), which can be exposed via process lists or shell history; users should avoid embedding secrets in command-line arguments when handling sensitive PDFs.
Install Mechanism
No install spec is embedded in the skill (instruction-only). The included references recommend platform package managers (winget, brew, apt, dnf) and a source archive; these are standard. Verify you install pdftk from official distro/package sources or the vendor site if you need the binary.
Credentials
The skill requests no environment variables, secrets, or config paths. The only sensitive items referenced are passwords shown as pdftk command arguments in examples — these are user-supplied at runtime and not declared env requirements.
Persistence & Privilege
always is false and the skill is user-invocable; it does not request persistent or elevated platform privileges and does not modify other skills or system-wide agent settings.
Assessment
This skill is a helpful reference for using the pdftk CLI and appears internally consistent. Before using: (1) Install pdftk from your OS package manager or the vendor site and verify the binary (do not download from untrusted URLs). (2) Avoid putting PDF passwords on the command line — prefer protected inputs or interactive prompts to prevent leakage via process lists/shell history. (3) Be mindful that pdftk operates on local files: ensure you only process files you have permission to handle and that you protect sensitive PDFs. (4) If you plan to redistribute pdftk binaries, review the licensing notes included in the references.

Like a lobster shell, security has layers — review code before you run it.

Current versionv1.0.1
Download zip
latestvk974a29zyrmh8949y59edeamdn818q6w

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

SKILL.md

PDFtk 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
  • 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

IssueSolution
pdftk command not foundVerify installation; check that pdftk is in your system PATH
Cannot decrypt PDFEnsure you are providing the correct owner or user password via input_pw
Output file is empty or corruptCheck input file integrity; try running pdftk input.pdf output repaired.pdf first
Form fields not visible after fillUse the flatten flag to merge fields into the page content
Watermark not appearingEnsure the input PDF has transparent regions; use stamp for opaque overlays
Permission denied errorsCheck file permissions on input and output paths

References

Bundled reference documents in the references/ folder:

Files

6 total
Select a file
Select a file to preview.

Comments

Loading comments…