Catalog
github/pdftk-server

github

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 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.

v1.0Latest
New~1.2kUpdated Jun 26, 2026

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:

Files6
6 files · 24.9 KB

Select a file to preview

Overall Score

86/100

Grade

A

Excellent

Safety

85

Quality

88

Clarity

87

Completeness

82

Summary

PDFtk Server is a comprehensive skill that teaches users how to use the pdftk command-line tool for PDF manipulation tasks including merging, splitting, rotating, encrypting, decrypting, watermarking, form-filling, and metadata extraction. The skill provides installation instructions, step-by-step workflows with command examples, a troubleshooting guide, and references to detailed manual pages and practical examples.

Static Analysis Findings

1 finding

Patterns detected by deterministic static analysis before AI scoring. Hover over any finding code for detailed information and remediation guidance.

Destructive Operation
SEC-002Privilege Escalation4x in 2 files

Privilege escalation (sudo)

SKILL.mdsudo asudo d2x
references/download.mdsudo asudo d2x

Detected Capabilities

shell executionfile readfile writepackage installation via system package managerpdf manipulationmetadata extraction

Trigger Keywords

Phrases that MCP clients use to match this skill to user intent.

merge pdf filessplit pdf pagesencrypt pdfdecrypt pdffill pdf formwatermark pdfrotate pdf pagesextract pdf metadatarepair corrupted pdfcollate scanned pages

Risk Signals

INFO

sudo apt-get install pdftk (privilege escalation in installation context)

SKILL.md, references/download.md
INFO

sudo dnf install pdftk (privilege escalation in installation context)

SKILL.md, references/download.md

Referenced Domains

External domains referenced in skill content, detected by static analysis.

gcc.gnu.orghpux.connect.org.ukmingw.orgpackages.debian.orgpackages.ubuntu.compdflabs.onfastspring.comwww.apache.orgwww.bouncycastle.orgwww.freshports.orgwww.gnu.orgwww.pdflabs.comxmlgraphics.apache.org

Use Cases

  • Merge multiple PDF files into a single document
  • Split a PDF into individual pages or extract specific page ranges
  • Rotate PDF pages in any direction
  • Encrypt or decrypt PDF files with password protection
  • Fill PDF form fields from FDF/XFDF data files
  • Apply watermarks or overlays to PDFs
  • Extract metadata, bookmarks, and form field information
  • Repair corrupted PDF files
  • Attach or extract files embedded in PDFs
  • Collate separately scanned even and odd pages

Quality Notes

  • Excellent scope definition: skill clearly documents when pdftk should be used and prerequisites
  • Comprehensive workflow documentation with command examples for 12+ common tasks
  • Well-organized step-by-step instructions that would allow an agent to execute each operation
  • Detailed troubleshooting section with concrete solutions for common issues
  • Good use of tables for permissions and troubleshooting reference
  • All referenced files are present and well-organized in references/ directory
  • Supporting documentation is thorough: manual page, CLI examples, download instructions, and licensing info
  • Clear syntax documentation with handle-based composition examples
  • Appropriate warnings about password requirements and file permissions
  • Markdown structure is professional and easy to follow
Model: claude-haiku-4-5-20251001Analyzed: Jun 26, 2026

Reviews

Add this skill to your library to leave a review.

No reviews yet

Be the first to share your experience.

Use github/pdftk-server in your dev environment

Command Palette

Search for a command to run...