Skill này làm gì
Skill này giúp AI tạo và chỉnh sửa tệp PDF. Skill dành cho người cần báo cáo, biểu mẫu, tài liệu gộp hoặc PDF có bảo vệ.
Khi nào nên dùng
- ✓Khi bạn yêu cầu một báo cáo, thư hoặc bản tóm tắt dạng PDF.
- ✓Khi bạn cần điền, gộp, tách hoặc đóng dấu mờ một PDF có sẵn.
- ✓Khi bạn cần một biểu mẫu điền được hoặc một PDF dùng phông chữ tùy chỉnh hay bố cục chính xác.
Liên kết skill
https://github.com/spinabot/brigade/blob/main/skills/pdf/SKILL.mdSao 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
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Gộp ba hợp đồng PDF này thành một tệp và thêm hình mờ DRAFT trên mọi trang.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
AI dùng các công cụ tạo đơn giản cho tài liệu cơ bản và công cụ chỉnh sửa cho PDF có sẵn. Với công việc chi tiết, AI viết một script để vẽ bố cục, nhúng phông chữ và tạo trường biểu mẫu.
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.
pdf — professional PDFs
| Need | Path |
|---|---|
| Simple content PDF (title, headings, paragraphs, image) | Path 1 — make_document tool |
| Fill an existing form, merge/split/stamp/watermark | Path 2 — edit_document tool |
| Form-field CREATION, vector drawing, embedded fonts (bold/CJK), precise layout, encryption, page surgery | Path 3 — script @cantoo/pdf-lib via brigade exec-node |
| Pixel-perfect, brand-styled layout from HTML/CSS | Path 4 — HTML→PDF (optional binary) |
Note: PDF is a final format with no reflow engine. If the recipient must edit, deliver the editable source (
.docx/.xlsx) and the PDF.
Path 1 — quick content PDF (make_document tool)
make_document(format="pdf", content={ title, pages:[{ heading, paragraphs, image:{path} }] })
Flow layout, US-Letter, single column, word-wrapped. Good for reports/summaries/letters. For forms, precise layout, or custom fonts → Path 3.
Path 2 — edit an existing PDF (edit_document tool)
fill_form {fields}— fill existing AcroForm fields by name (text/checkbox/dropdown).merge {pdfs}/add_pages {pdfs}·split {pages}·remove_pages {pages}.stamp {text}·watermark {text}(45° translucent).
Form decision: first detect whether the PDF has real fillable fields. If it does → fill them (clean, type-validated). If it's a flat/scanned form (no fields) → you must draw text at coordinates instead (Path 3, annotations) — never assume fields exist.
Path 3 — full power: script @cantoo/pdf-lib
Brigade bundles @cantoo/pdf-lib (a maintained pdf-lib fork — note the scoped name) plus @pdf-lib/fontkit (custom-font embedding) and unpdf (text extraction). write a gen.cjs, run brigade exec-node gen.cjs:
// gen.cjs — illustrative
const fs = require("node:fs");
const { PDFDocument, StandardFonts, rgb } = require("@cantoo/pdf-lib");
(async () => {
const pdf = await PDFDocument.create();
// embed a custom font (real bold / CJK / Unicode) — requires fontkit
// const fontkit = require("@pdf-lib/fontkit"); pdf.registerFontkit(fontkit);
// const font = await pdf.embedFont(fs.readFileSync("Brand-Bold.ttf"));
const font = await pdf.embedFont(StandardFonts.HelveticaBold);
const page = pdf.addPage([612, 792]); // US Letter; origin is BOTTOM-LEFT, y-up
page.drawText("Invoice", { x: 54, y: 720, size: 22, font, color: rgb(0.1, 0.1, 0.1) });
page.drawRectangle({ x: 54, y: 700, width: 504, height: 1, color: rgb(0.8, 0.8, 0.8) }); // vector rule
// CREATE fillable form fields
const form = pdf.getForm();
const name = form.createTextField("client.name");
name.addToPage(page, { x: 120, y: 640, width: 300, height: 18 });
const agree = form.createCheckBox("agree");
agree.addToPage(page, { x: 54, y: 600, width: 14, height: 14 });
// form.flatten(); // bake fields into static content if no further filling
fs.writeFileSync(process.argv[2] || "out.pdf", await pdf.save());
console.log("wrote");
})();
@cantoo/pdf-lib covers: draw text/lines/rects/ellipses/SVG paths/images; embed custom TTF/OTF fonts (subset, full Unicode); create AND fill AcroForm text/checkbox/radio/dropdown/option-list fields; flatten; copy/merge/split/rotate pages; metadata; password encryption (the reason this fork is bundled). Extract text/structure with unpdf.
Coordinate gotcha: pdf-lib origin is bottom-left, y-up. If you author field positions from a top-left image/spec, convert: y_pdf = pageHeight - y_top - height. One coordinate convention per script.
Path 4 — pixel-perfect / branded PDF from HTML+CSS (optional)
pdf-lib has no HTML/CSS layout engine — for a designed, brand-styled document, render HTML→PDF. Use whatever is present (detect first):
command -v soffice >/dev/null 2>&1 && soffice --headless --convert-to pdf brand.html # LibreOffice route
A headless browser (Puppeteer/Playwright page.pdf()) is the higher-fidelity alternative if installed. Prefer Path 1/3 unless the brand design genuinely requires CSS.
Conventions
- Use real AcroForm fields when filling a fillable PDF; only fall back to drawn-text annotations for flat/scanned forms.
- Embed a font for anything beyond basic Latin — standard PDF fonts lack bold-as-a-face and all CJK/emoji (missing glyphs render as boxes).
- Keep ≥0.5" margins; align to a grid; don't rely on text reflowing (there's no
Câu hỏi thường gặp
Skill có điền được biểu mẫu có sẵn không?
Có. Skill điền các trường biểu mẫu theo tên, và cũng có thể tạo trường mới cho biểu mẫu phức tạp hơn.
PDF có chỉnh sửa được sau khi tạo không?
PDF không có định dạng chỉnh sửa dễ dàng, nên khi người nhận cần sửa, skill khuyên gửi kèm tệp nguồn có thể chỉnh sửa.
Skill có bảo vệ được PDF không?
Có. Skill có thể mã hóa PDF và trích xuất văn bản từ một PDF.
Chi tiết
Mô tả gốc của tác giả
Create and edit PDFs to a professional standard — generate from content, draw vector/precise layouts, embed custom (incl. CJK/Unicode) fonts, CREATE and fill AcroForm fields (text/checkbox/radio/dropdown), flatten, merge/split/rotate, stamp/watermark, encrypt, and extract text. Use when the user asks Brigade to make a PDF, fill or build a PDF form, or combine/split/stamp/secure PDFs.
repo: spinabot/brigade
Độ phổ biến
- Sao GitHub
- 11k
- Vị trí xếp hạng
- #11734
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
1password
11kDạy agent của bạn cài đặt công cụ dòng lệnh 1Password và đăng nhập an toàn, sau đó đọc hoặc chèn các bí mật đã lưu khi cần.
apple-reminders
11kCho phép agent của bạn xem, thêm, sửa, hoàn thành và xóa Apple Reminders từ terminal, gồm danh sách và bộ lọc theo ngày.
bluebubbles
11kCho phép agent của bạn gửi và quản lý iMessage qua BlueBubbles, gồm tin nhắn, tệp đính kèm, biểu cảm tapback, chỉnh sửa và cài đặt nhóm.
camsnap
11kCho phép agent của bạn chụp ảnh, quay clip ngắn hoặc theo dõi chuyển động từ các camera an ninh mạng mà bạn đã thiết lập.
Skill tương tự
feishu-doc
394kGiúp agent của bạn đọc, tạo và sửa tài liệu đám mây Feishu, gồm văn bản, hình ảnh và bảng, bằng công cụ tài liệu.
feishu-drive
394kCho phép agent của bạn duyệt, sắp xếp và bình luận các file trong một thư mục đám mây Feishu đã được chia sẻ với bot.
feishu-perm
394kGiúp agent của bạn kiểm tra và thay đổi ai có quyền truy cập một file Feishu, chọn quyền nhỏ nhất đáp ứng yêu cầu của bạn.