Pdftk Server
GitHubOfficialFirst committed by jhaugaDistributed by GitHub
- Skill
- Tool integration
- Automation and integrations
- MIT
- Low risk
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
PDFtk Server is a powerful command-line utility designed for programmatic PDF document manipulation. It provides a robust set of operations for handling PDF files, including merging, splitting, rotating, and encrypting documents. It also supports advanced features like filling PDF forms, applying watermarks or stamps, extracting metadata, and repairing corrupted files. This tool is ideal for users who need to automate document processing tasks directly from a terminal or within scripts.
What it does
- Merges multiple PDF files into a single document
- Splits or bursts PDF files into individual pages
- Encrypts and decrypts PDF files with password protection
- Fills PDF form fields using FDF or XFDF data
- Applies background watermarks or foreground stamps to pages
- Extracts metadata, bookmarks, and embedded file attachments
When to use it
- When you need to automate PDF processing tasks via command-line scripts
- When performing batch operations on large numbers of PDF files
- When you need to secure sensitive documents with password encryption
- When preparing documents by merging, rotating, or removing specific pages
- When extracting data or attachments from existing PDF files
Advantages
- Enables automation of repetitive PDF tasks
- Supports complex operations like form flattening and page collation
- Lightweight command-line interface suitable for server environments
- Provides granular control over PDF structure and security
Usage examples
- “How do I merge three PDF files into one using PDFtk?”
- The agent provides the command: pdftk file1.pdf file2.pdf file3.pdf cat output merged.pdf.
- “I need to password protect a PDF file, how can I do that?”
- The agent provides the command: pdftk input.pdf output secured.pdf owner_pw mypassword user_pw userpass.
- “How can I split a PDF into individual pages?”
- The agent provides the command: pdftk input.pdf burst.
- “How do I fill a PDF form and make it non-editable?”
- The agent provides the command: pdftk form.pdf fill_form data.fdf output filled.pdf flatten.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/github/pdftk-server/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip pdftk-server.zip -d .agents/skills
Documentation by jhauga
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.ServermacOS:
brew install pdftk-javaLinux (Debian/Ubuntu):
sudo apt-get install pdftkLinux (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.pdfUsing handles for more control:
pdftk A=file1.pdf B=file2.pdf cat A B output merged.pdfSplit a PDF into Individual Pages
pdftk input.pdf burstExtract Specific Pages
Extract pages 1-5 and 10-15:
pdftk input.pdf cat 1-5 10-15 output extracted.pdfRemove Specific Pages
Remove page 13:
pdftk input.pdf cat 1-12 14-end output output.pdfRotate Pages
Rotate all pages 90 degrees clockwise:
pdftk input.pdf cat 1-endeast output rotated.pdfEncrypt 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 userpassDecrypt a PDF
Remove encryption using the known password:
pdftk secured.pdf input_pw mypassword output unsecured.pdfFill 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 flattenApply 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.pdfStamp an Overlay
Place a single-page PDF on top of every page of the input:
pdftk input.pdf stamp overlay.pdf output stamped.pdfExtract Metadata
Export bookmarks, page metrics, and document information:
pdftk input.pdf dump_data output metadata.txtRepair a Corrupted PDF
Pass a broken PDF through pdftk to attempt automatic repair:
pdftk broken.pdf output fixed.pdfCollate Scanned Pages
Interleave separately scanned even and odd pages:
pdftk A=even.pdf B=odd.pdf shuffle A B output collated.pdfTroubleshooting
| 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
Files
- ATTRIBUTION.mdAdded by AutoGineer853 B
- LICENSELicence file added by AutoGineer1.0 KiB
- SKILL.md4.6 KiB
- references/download.md3.2 KiB
- references/pdftk-cli-examples.md3.3 KiB
- references/pdftk-man-page.md6.9 KiB
- references/pdftk-server-license.md1.5 KiB
- references/third-party-materials.md9.0 KiB
references/third-party-materials.md
Third-Party Materials
PDFtk Server (pdftk) uses third-party libraries. Depending on the target operating system, some of these are linked or distributed with pdftk. These are their licensing terms.
GCC libgcj
The libgcj library is licensed under the terms of the GNU General Public License.
Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination.
As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.
Click to read the GNU General Public License Version 2.
Libgcj is part of GCC, so you can find its source code in the GCC source code.
GCC libgcc and libstdc++
GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation.
Click to read the GNU General Public License Version 3.
Click to read the GCC Runtime Library Exception Version 3.1.
Libgcc and libstdc++ are part of GCC, so you can find their source code in the GCC source code.
GNU Classpath
GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.
GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination.
As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.
Click to read the GNU General Public License Version 2.
Classpath is part of GCC, so you can find its source code in the GCC source code.
Bouncy Castle
The Bouncy Castle License
Copyright (c) 2000-2008 The Legion Of The Bouncy Castle (http://www.bouncycastle.org)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Download the Bouncy Castle source code from: http://www.bouncycastle.org/.
iText (itext-paulo)
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.
Click to read the GNU Library General Public License Version 2.
The iText source code used in pdftk is slightly modified from its original version. This modified version is included with the pdftk source code.
MinGW Runtimes (Windows Only)
MinGW runtime: The MinGW base runtime package has been placed in the public domain, and is not governed by copyright. This basically means that you can do what you like with the code.
w32api: You are free to use, modify and copy this package. No restrictions are imposed on programs or object files linked with this library. You may not restrict the usage of this library. You may distribute this library as part of another package or as a modified package if, and only if, you do not restrict the usage of the portions consisting of this (optionally modified) library. If distributed as a modified package, then a copy of this notice must be included.
This library is distributed in the hope that it will be useful, but WITHOUT WARRANTY OF ANY KIND; without even the implied warranties of MERCHANTABILITY or of FITNESS FOR A PARTICULAR PURPOSE.
Download the MinGW runtime source code from: http://mingw.org/.
Libiconv
The GNU LIBICONV Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
The GNU LIBICONV Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.
Click to read the GNU Library General Public License.
Download the libiconv source code from: http://www.gnu.org/software/libiconv/
Apache Batik
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Click to read the Apache License Version 2.0.
Click to read the Apache Batik NOTICE file.
Download the Apache Batik source code from: http://xmlgraphics.apache.org/batik/.
Requirements and compatibility
Written for: GitHub Copilot
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
What our scanner noticed· Low risk
- Instructions that use the network
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- First committed by
jhauga
- Publisher
- GitHub (Official)
- Distributed by
- GitHub
- Source
- github/awesome-copilot · skills/pdftk-server · commit 797337f
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
- Contributors
- jhauga
AutoGineer is not affiliated with or endorsed by jhauga or GitHub.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download pdftk-server.zip