PluginBench
Skill
Official
Fail
Audit score 45

pdftk-server

github/awesome-copilot

Command-line PDF manipulation: merge, split, encrypt, fill forms, watermark, and more.

What is pdftk-server?

PDFtk Server is a command-line tool for comprehensive PDF document manipulation. Use it when you need to merge, split, rotate, encrypt, decrypt, fill forms, apply watermarks, extract metadata, or repair PDFs.

  • Merge or join multiple PDF files into one document
  • Split or burst PDFs into individual pages
  • Rotate PDF pages in 90-degree increments
  • Encrypt and decrypt PDFs with password protection
  • Fill PDF form fields from FDF/XFDF data and flatten results
  • Apply background watermarks or foreground stamp overlays

How to install pdftk-server

npx skills add https://github.com/github/awesome-copilot --skill pdftk-server
Prerequisites
  • PDFtk Server installed (Windows: winget install PDFLabs.PDFtk.Server; macOS: brew install pdftk-java; Linux: apt-get or dnf install pdftk)
  • Access to a terminal or command prompt
  • Verify installation by running pdftk --version
Claude Code
Cursor
Windsurf
Cline

How to use pdftk-server

  1. 1.Verify pdftk is installed and accessible in your PATH by running `pdftk --version`
  2. 2.Prepare your input PDF file(s) and any supporting files (FDF data, watermarks, overlays)
  3. 3.Construct the appropriate pdftk command for your task (merge, split, encrypt, fill, etc.)
  4. 4.Execute the command in your terminal, specifying input file(s) and output file name
  5. 5.Verify the output file was created and contains the expected result
  6. 6.For complex workflows, chain multiple pdftk commands or integrate into scripts

Use cases

Good for
  • Merge scanned documents or reports from multiple sources into a single file
  • Burst a multi-page PDF into individual pages for processing or distribution
  • Encrypt sensitive PDFs with owner and user passwords before sharing
  • Fill out PDF forms programmatically using data from external sources
  • Apply company watermarks or confidentiality stamps to documents
Who it's for
  • Document automation engineers
  • System administrators managing batch PDF workflows
  • Developers building PDF processing pipelines
  • Business analysts automating form processing
  • Anyone needing command-line PDF manipulation without GUI tools

pdftk-server FAQ

What is the difference between watermark and stamp?

Watermark places a PDF behind the input pages (typically for background effects), while stamp places a PDF on top of the input pages (for overlays). Use watermark for subtle backgrounds and stamp for visible overlays.

How do I decrypt a PDF if I don't know the password?

PDFtk cannot decrypt a PDF without the correct password. If you have the owner password, use `input_pw` flag. If the PDF is password-protected and you lack credentials, you will need to contact the document owner.

Can I fill PDF forms without flattening them?

Yes. Omit the `flatten` flag to keep form fields editable after filling. Use `flatten` only if you want to merge the filled data into the page content and lock the form.

What should I do if pdftk produces an empty or corrupt output file?

First, verify the input PDF is not already corrupted by running `pdftk input.pdf output repaired.pdf`. Check file permissions on both input and output paths. Ensure sufficient disk space is available.

Is PDFtk Server free to use?

PDFtk Server is available under a proprietary license. Check the bundled license documentation (pdftk-server-license.md) for specific terms and any restrictions on your intended use.

Full instructions (SKILL.md)

Source of truth, from github/awesome-copilot.


name: pdftk-server description: '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 decrypt PDFs, fill PDF forms, apply watermarks, stamp overlays, extract metadata, burst documents into pages, repair corrupted PDFs, attach or extract files, or perform any PDF manipulation from the command line.'

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: