Skip to content
Skillpedia
Misc40k · #5258

pdftk-server

Makes your agent manipulate PDF files using the `pdftk` tool. It can merge, split, rotate, encrypt PDFs, and more, directly from the command line.

What it does

This tool helps you manipulate PDF files directly on your computer. You can merge multiple PDFs into one, split a PDF into separate pages, rotate pages, password-protect them, fill out forms, and even fix damaged PDFs.

When to use it

  • ✓When you need to combine several PDF documents into a single file.
  • ✓When you want to split a large PDF into individual pages.
  • ✓When you need to password-protect a PDF or remove an existing password.

Example of what to ask your AI

“Combine these three PDFs into one: 'document1.pdf', 'document2.pdf', 'document3.pdf'.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/github/awesome-copilot/blob/main/skills/pdftk-server/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/github/awesome-copilot/blob/main/skills/pdftk-server/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

You type specific commands on your computer that tell the tool what to do with the PDF files. For example, to merge two PDFs, you type a command listing the files and the name for the new file to be created.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add github/awesome-copilot --skill pdftk-server

Or download just the file:

curl -L https://raw.githubusercontent.com/github/awesome-copilot/main/skills/pdftk-server/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

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

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:

FAQ

What is 'pdftk-server'?

It's a program you install on your computer to do various things with PDF files using text commands.

Do I need to install anything?

Yes, you need to install 'PDFtk Server' on your computer. The installation instructions differ depending on whether you use Windows, macOS, or Linux.

Can I use this to edit text inside a PDF?

Not directly. This tool is for organizing, combining, splitting, securing, or filling forms in PDFs, but not for editing the existing text within them.

Details

Original description by the author

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.

repo: github/awesome-copilot

Popularity

GitHub stars
40k
Ranking position
#5258
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills