All skills
github avatar

/pdftk-server

@7953993 official
by githubgithub/awesome-copilot40k stars
5,040

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.

Use this Skill: https://skilld.dev/gh/github/awesome-copilot/pdftk-server

This session only. Nothing lands on disk.

referencespdftk-cli-examples.md

≈848 tokens on demand. Your agent reads this file only when SKILL.md points to it.

PDFtk CLI Examples

PDFtk is a command-line program. Use your computer terminal or command prompt when running these examples.

Collate Scanned Pages

Interleave even and odd scanned pages into a single document:

pdftk A=even.pdf B=odd.pdf shuffle A B output collated.pdf

If the odd pages are in reverse order:

pdftk A=even.pdf B=odd.pdf shuffle A Bend-1 output collated.pdf

Decrypt a PDF

Remove encryption from a PDF using its password:

pdftk secured.pdf input_pw foopass output unsecured.pdf

Encrypt a PDF Using 128-Bit Strength

Apply owner password encryption:

pdftk 1.pdf output 1.128.pdf owner_pw foopass

Require a password to open the PDF as well:

pdftk 1.pdf output 1.128.pdf owner_pw foo user_pw baz

Encrypt while still allowing printing:

pdftk 1.pdf output 1.128.pdf owner_pw foo user_pw baz allow printing

Join PDFs

Merge multiple PDFs into one:

pdftk in1.pdf in2.pdf cat output out1.pdf

Using handles for explicit control:

pdftk A=in1.pdf B=in2.pdf cat A B output out1.pdf

Using wildcards to merge all PDFs in a directory:

pdftk *.pdf cat output combined.pdf

Remove Specific Pages

Exclude page 13 from a document:

pdftk in.pdf cat 1-12 14-end output out1.pdf

Using a handle:

pdftk A=in1.pdf cat A1-12 A14-end output out1.pdf

Apply 40-Bit Encryption

Merge and encrypt with 40-bit strength:

pdftk 1.pdf 2.pdf cat output 3.pdf encrypt_40bit owner_pw foopass

Join Files When One Is Password-Protected

Supply the password for the encrypted input:

pdftk A=secured.pdf 2.pdf input_pw A=foopass cat output 3.pdf

Uncompress PDF Page Streams

Decompress internal streams for inspection or debugging:

pdftk doc.pdf output doc.unc.pdf uncompress

Repair Corrupted PDFs

Pass a broken PDF through pdftk to attempt repair:

pdftk broken.pdf output fixed.pdf

Burst a PDF into Individual Pages

Split each page into its own file:

pdftk in.pdf burst

Burst with encryption and limited printing:

pdftk in.pdf burst owner_pw foopass allow DegradedPrinting

Generate a PDF Metadata Report

Export bookmarks, metadata, and page metrics:

pdftk in.pdf dump_data output report.txt

Rotate Pages

Rotate the first page 90 degrees clockwise:

pdftk in.pdf cat 1east 2-end output out.pdf

Rotate all pages 180 degrees:

pdftk in.pdf cat 1-endsouth output out.pdf

Fill a PDF Form from Data

Populate form fields from an FDF file:

pdftk form.pdf fill_form data.fdf output filled_form.pdf

Flatten the form after filling (prevents further editing):

pdftk form.pdf fill_form data.fdf output filled_form.pdf flatten

Apply a Background Watermark

Stamp a watermark behind every page:

pdftk input.pdf background watermark.pdf output watermarked.pdf

Stamp an Overlay on Top

Apply an overlay PDF on top of every page:

pdftk input.pdf stamp overlay.pdf output stamped.pdf

Attach Files to a PDF

Embed files as attachments:

pdftk input.pdf attach_files table.html graph.png output output.pdf

Extract Attachments from a PDF

Unpack all embedded files:

pdftk input.pdf unpack_files output /path/to/output/

Source: SKILL.md on GitHub

1 warning16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    This skill provides comprehensive instructions for using the pdftk command-line tool to manipulate PDF files. It includes standard installation procedures for multiple operating systems and guides for common tasks like merging, splitting, and encrypting PDFs. While it involves processing external PDF documents and executing commands, these activities are central to the tool's legitimate purpose and are documented safely using illustrative examples.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    6/6 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 7953993. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 20 hours ago.

Activeupdated 8 months ago
  • CLI
  • pdftk
  • pdf
  • command-line
  • merge
  • encryption
  • forms
  • watermark

README badge

README badge for github/awesome-copilot/pdftk-server

Wraps the pdftk command-line tool for PDF manipulation tasks like merging, splitting, rotating, encrypting, decrypting, filling forms, watermarking, and extracting metadata. Use this skill when you need to perform batch PDF operations from the command line without a GUI tool.

Generated from the current SKILL.md.

Does pdftk work on Windows, macOS, and Linux?
Yes. Installation differs by platform: Windows uses winget, macOS uses Homebrew (pdftk-java), and Linux uses apt or dnf depending on the distribution.
Can this skill encrypt and decrypt PDFs?
Yes. You can encrypt with owner and user passwords using the owner_pw and user_pw flags, and decrypt by providing the password with input_pw.
Does this handle PDF form filling?
Yes. You can populate form fields from FDF/XFDF data files and flatten the result to prevent further edits.
Can I repair corrupted PDF files?
Yes. Running pdftk on a broken PDF and writing the output often repairs corruption automatically.
What is required to use this skill?
PDFtk Server must be installed on your system and accessible from the command line. Verify installation by running pdftk --version.

Generated from the current SKILL.md. These answers refresh after source changes.