Chuyển đến nội dung
Skillpedia
PDF, Word và slide40k · #7315

pdftk-server

Skill này làm gì

Công cụ này giúp bạn xử lý file PDF trực tiếp trên máy tính. Bạn có thể gộp nhiều PDF thành một, tách PDF thành từng trang, xoay trang, đặt mật khẩu, điền biểu mẫu và thậm chí sửa các PDF bị hỏng.

Khi nào nên dùng

  • ✓Khi bạn cần gộp nhiều tài liệu PDF thành một file.
  • ✓Khi bạn muốn tách một PDF lớn thành từng trang riêng.
  • ✓Khi bạn cần đặt mật khẩu cho PDF hoặc gỡ mật khẩu hiện có.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/github/awesome-copilot/blob/main/skills/pdftk-server/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Gộp ba PDF này thành một: 'document1.pdf', 'document2.pdf', 'document3.pdf'.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Bạn gõ các lệnh cụ thể trên máy tính để nói với công cụ phải làm gì với các file PDF. Ví dụ, để gộp hai PDF, bạn gõ một lệnh liệt kê các file và tên cho file mới cần tạo.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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:

Câu hỏi thường gặp

“pdftk-server” là gì?

Đó là một chương trình bạn cài trên máy tính để thực hiện nhiều thao tác với file PDF bằng lệnh văn bản.

Tôi có cần cài đặt gì không?

Có, bạn cần cài 'PDFtk Server' trên máy tính. Hướng dẫn cài đặt khác nhau tùy theo bạn dùng Windows, macOS hay Linux.

Tôi có thể dùng công cụ này để sửa văn bản trong PDF không?

Không trực tiếp. Công cụ này dùng để sắp xếp, gộp, tách, bảo mật hoặc điền biểu mẫu trong PDF, nhưng không dùng để chỉnh sửa văn bản có sẵn trong đó.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
40k
Vị trí xếp hạng
#7315
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự