Agent skill

PDF Skill

by OpenLoaf in OpenLoaf/OpenLoaf

PDF 读/写/转/OCR 一体化。触发场景:总结 PDF、读文本或表格、填 AcroForm 表单、渲染页面为图、合并/拆分/水印/旋转/加密、创建新 PDF(发票/报告)、PDF ↔ docx/md/txt 互转。典型说法:“总结这份 PDF”、“填一下这个 PDF 表单”、“把几个 PDF 合一起”、“PDF 加水印”、“PDF 转 Word”、“扫描件 OCR”、“看看 PDF 第 3…

AGPL-3.0Auto-check passedDocuments & Office

Install PDF Skill

skills CLI
$ npx skills add OpenLoaf/OpenLoaf --skill pdf-skill -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install OpenLoaf/OpenLoaf pdf-skill --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/OpenLoaf/OpenLoaf.git skills-src && mkdir -p .claude/skills && cp -r skills-src/apps/server/src/ai/builtin-skills/pdf .claude/skills/pdf-skill && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
pdf-skill
GitHub stars
107
Token cost
~1.5k tokens
SKILL.md length
237 words
Files
1
Skills in repo
34
Repo updated
First seen
Licence
AGPL-3.0

At a glance

PDF 读/写/转/OCR 一体化。触发场景:总结 PDF、读文本或表格、填 AcroForm 表单、渲染页面为图、合并/拆分/水印/旋转/加密、创建新 PDF(发票/报告)、PDF ↔ docx/md/txt 互转。典型说法:“总结这份 PDF”、“填一下这个 PDF 表单”、“把几个 PDF 合一起”、“PDF 加水印”、“PDF 转 Word”、“扫描件 OCR”、“看看 PDF 第 3…

  • Works in 5 steps: 读:PdfInspect 是唯一入口 → 写:JsSandbox + pdf-lib / pdfkit → OCR(扫描件) → …
  • Tasks that involve PDF
  • SKILL.md covers 工具清单, 1. 读:PdfInspect 是唯一入口, 2. 写:JsSandbox + pdf-lib /… and 3. OCR(扫描件), plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

PDF Skill is an agent skill from OpenLoaf/OpenLoaf. PDF 读/写/转/OCR 一体化。触发场景:总结 PDF、读文本或表格、填 AcroForm 表单、渲染页面为图、合并/拆分/水印/旋转/加密、创建新 PDF(发票/报告)、PDF ↔ docx/md/txt 互转。典型说法:“总结这份 PDF”、“填一下这个 PDF 表单”、“把几个 PDF 合一起”、“PDF 加水印”、“PDF 转 Word”、“扫描件 OCR”、“看看 PDF 第 3 页长什么样”。用户提到 .pdf 文件、要产出 PDF、或要对 PDF 做任何改动都加载本技能。

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Documents & Office, covering PDF and Word documents. It works with Microsoft Word. The repository describes itself as: 🍞Open-source, local-first AI workspace with Agents, multi-model chat (GPT/Claude/Gemini/DeepSeek), Notion-like docs, AI image & video generation, email, calendar & terminal…. The licence is AGPL-3.0.

When your agent uses it

  • Tasks that involve PDF
  • Tasks that involve Word documents

Example prompts

  • “总结这份 PDF”
  • “填一下这个 PDF 表单”
  • “把几个 PDF 合一起”
  • “/pdf-skill”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. 读:PdfInspect 是唯一入口
  2. 写:JsSandbox + pdf-lib / pdfkit
  3. OCR(扫描件)
  4. 格式互转
  5. 常见错误兜底

What it can do on your machine

Read from SKILL.md and the folder at commit f7eccf6. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are javascript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

PDF Skill loads about 1.5k tokens when it runs. Until then it costs about 64 tokens; SKILL.md has 237 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~64
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from OpenLoaf/OpenLoaf at commit f7eccf6, republished under its AGPL-3.0 licence (© OpenLoaf). 237 words, ~1,544 tokens.

Download SKILL.mdSave it as .claude/skills/pdf-skill/SKILL.md (or your agent's skills folder).
name
pdf-skill
description
PDF 读/写/转/OCR 一体化。触发场景:总结 PDF、读文本或表格、填 AcroForm 表单、渲染页面为图、合并/拆分/水印/旋转/加密、创建新 PDF(发票/报告)、PDF ↔ docx/md/txt 互转。典型说法:“总结这份 PDF”、“填一下这个 PDF 表单”、“把几个 PDF 合一起”、“PDF 加水印”、“PDF 转 Word”、“扫描件 OCR”、“看看 PDF 第 3 页长什么样”。用户提到 .pdf 文件、要产出 PDF、或要对 PDF 做任何改动都加载本技能。

PDF 技能

读用 PdfInspect;写 / 改 / 创建一律用 JsSandbox 跑 Node 脚本调用 pdf-lib / pdfkit / pdf-parse 等预装库;格式互转用 DocConvert;扫描件走 CloudImageUnderstand。

工具清单

工具做什么只读
PdfInspect读:summary / text / tables / form-fields / form-structure / images / annotations / render是
JsSandbox所有写操作:创建新 PDF、合并、水印、旋转、填表、加密…… 用 pdf-lib / pdfkit 代码实现否
DocConvert格式互转:pdf ↔ docx / html / md / txt / xlsx否
CloudImageUnderstand扫描 PDF 的 OCR 入口(云端,会扣积分)否

加载(两步,缺一不可):

  1. LoadSkill pdf-skill —— 仅把本技能文档拉进上下文。
  2. ToolSearch(query: "select:PdfInspect,JsSandbox,DocConvert") —— 激活工具 schema。

Read 对 .pdf 只走轻量摘要;任何分析/总结/填/改/转/OCR PDF 都走 PdfInspect + JsSandbox。


1. 读:PdfInspect 是唯一入口

不知道 PDF 长啥样先 summary:

PdfInspect { action: "summary", filePath: "…" }

返回 pageCount / fileSize / characterCount / hasForm / encryption / textType,按 textType:

textType下一步
extractablePdfInspect(text) 直接取全文
scanned / cid-encodedPdfInspect(render, pageRange) → 再调 CloudImageUnderstand 对每张 PNG OCR
isEncrypted: true走下面 JsSandbox pdf-lib 解密,或 PdfInspect(password)

大 PDF 必传 pageRange(如 "1-5"),否则触发截断。

AcroForm 表单:PdfInspect(form-fields) 拿 checkedValue / radioOptions 再填。


2. 写:JsSandbox + pdf-lib / pdfkit

首选 pdf-lib(编辑已有 PDF / 合并 / 水印 / 旋转 / 填表 / 解密); 从零生成复杂布局用 pdfkit(矢量 + 文字 + 图)。

2.1 Demo:创建一份中文发票 PDF(pdfkit)
js
import PDFDocument from 'pdfkit'
import fs from 'node:fs'

const doc = new PDFDocument({ size: 'A4', margin: 48 })
doc.pipe(fs.createWriteStream('invoice.pdf'))

doc.fontSize(22).text('INVOICE', { align: 'right' })
doc.moveDown()
doc.fontSize(10).text('Acme Corp', { align: 'right' })
doc.text('Invoice #2026-042   Date: 2026-04-20', { align: 'right' })
doc.moveDown()

// 简易表格
const rows = [
  ['Widget', 1, 50.00],
  ['Gadget', 2, 30.00],
]
doc.fontSize(12).text('Description     Qty     Unit     Total')
doc.moveTo(48, doc.y).lineTo(547, doc.y).stroke()
let total = 0
for (const [name, qty, unit] of rows) {
  const line = qty * unit
  total += line
  doc.text(`${name.padEnd(14)} ${qty}       $${unit.toFixed(2)}   $${line.toFixed(2)}`)
}
doc.moveDown().fontSize(14).text(`Total: $${total.toFixed(2)}`, { align: 'right' })

doc.end()
await new Promise(r => doc.on('end', r))
console.log('invoice.pdf written')

CJK 提示:pdfkit 默认字体不含中文字形。若要出中文,先用 doc.registerFont('cn', '/path/to/NotoSansCJK.ttf') 再 doc.font('cn')。系统 fallback 字体不保证覆盖。

2.2 Demo:给已有 PDF 加 CONFIDENTIAL 水印(pdf-lib)
js
import { PDFDocument, rgb, degrees, StandardFonts } from 'pdf-lib'
import fs from 'node:fs/promises'

const src = await fs.readFile(process.argv[2] ?? 'input.pdf')
const pdf = await PDFDocument.load(src)
const font = await pdf.embedFont(StandardFonts.HelveticaBold)

for (const page of pdf.getPages()) {
  const { width, height } = page.getSize()
  page.drawText('CONFIDENTIAL', {
    x: width / 2 - 140,
    y: height / 2,
    size: 64,
    font,
    color: rgb(0.9, 0.1, 0.1),
    opacity: 0.25,
    rotate: degrees(-30),
  })
}

const out = await pdf.save()
await fs.writeFile('watermarked.pdf', out)
console.log(`watermarked ${pdf.getPageCount()} pages`)
2.3 Demo:合并 PDF(pdf-lib)
js
import { PDFDocument } from 'pdf-lib'
import fs from 'node:fs/promises'

const merged = await PDFDocument.create()
for (const p of ['a.pdf', 'b.pdf', 'c.pdf']) {
  const src = await PDFDocument.load(await fs.readFile(p))
  const pages = await merged.copyPages(src, src.getPageIndices())
  pages.forEach(pg => merged.addPage(pg))
}
await fs.writeFile('merged.pdf', await merged.save())
console.log(`merged → ${merged.getPageCount()} pages`)
2.4 Demo:填 AcroForm 表单(先 PdfInspect(form-fields) 拿 checkedValue)
js
import { PDFDocument } from 'pdf-lib'
import fs from 'node:fs/promises'

const pdf = await PDFDocument.load(await fs.readFile('form.pdf'))
const form = pdf.getForm()
form.getTextField('full_name').setText('张三')
form.getCheckBox('agree').check()          // 若 PdfInspect 给出 checkedValue='Y',用 setValue('Y')
form.getRadioGroup('gender').select('M')
// form.flatten() // 想锁表单就 flatten
await fs.writeFile('filled.pdf', await pdf.save())
console.log('form filled')
2.5 Demo:解密 / 旋转 / 抽页
js
// 解密
import { PDFDocument } from 'pdf-lib'
const pdf = await PDFDocument.load(buf, { password: 'secret', ignoreEncryption: false })
await fs.writeFile('unlocked.pdf', await pdf.save())

// 旋转第 1 页 90°
pdf.getPage(0).setRotation(degrees(90))

// 抽出第 3、5 页到新 PDF
const out = await PDFDocument.create()
const [p3, p5] = await out.copyPages(pdf, [2, 4])
out.addPage(p3); out.addPage(p5)

3. OCR(扫描件)

PdfInspect(summary)              // textType == 'scanned'
PdfInspect(render, pageRange)    // 得到 [<asset>/render-p1.png, ...]
CloudImageUnderstand(image=<上面每张 png>, question='精确识别并提取中文文字')

4. 格式互转

DocConvert(from="pdf", to="docx", sourcePath="…")   # PDF → Word 编辑
DocConvert(from="docx", to="pdf", sourcePath="…")   # Word → PDF 分发

DocConvert 比 JsSandbox + pdf-lib 快且排版忠实;互转优先它。


5. 常见错误兜底

症状原因处理
pdfkit 中文乱码 / 方块默认字体不含 CJK 字形先 registerFont('cn', '/path/to/NotoSansCJK.ttf')
pdf-lib 加载报 EncryptedPDFError文件加密PDFDocument.load(buf, { password: '…' })
水印覆盖不均PDF 页面大小不同循环 page.getSize() 按页算 x/y
合并后字体变样原 PDF 嵌字体不完整用 pdf-lib 的 useObjectStreams: false 重写
TypeError: Cannot read properties of undefined (reading 'save')pdfkit 没有 doc.save() / doc.restore()(那是 Canvas 2D API)颜色/字号状态直接用 doc.fillColor() / doc.fontSize() 切换即可,不需要保存-恢复栈。最终文档落盘用 doc.pipe(fs.createWriteStream(...)); doc.end()

修脚本:JsSandbox(action="edit-and-run", scriptPath=<上次的>, edits=[{find,replace}]) 只传改动点。

© OpenLoaf, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in apps/server/src/ai/builtin-skills/pdf of OpenLoaf/OpenLoaf.

Open the folder on GitHubat commit f7eccf6

Compare with similar skills

PDF Skill next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

PDF Skill compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
PDF Skill this skillOpenLoaf/OpenLoaf107—~1.5kAutomated safety check: PassAGPL-3.0
MarkitdownImCa0/just-laws78114 repos~3.2kAutomated safety check: NotesMIT
Gzh Designisjiamu/gzh-design-skill3.9k1 repos~2.2kAutomated safety check: PassAGPL-3.0
GenOffice Document CLIgenspark-ai/genoffice8.8k—~19kAutomated safety check: PassApache-2.0
Translate Bookdeusyu/translate-book2.1k—~5.5kAutomated safety check: NotesMIT
Docsagentdocsagent/docsagent625—~834Automated safety check: PassNone

Similar skills

  • Markitdown

    ImCa0/just-laws

    Convert files and office documents to Markdown. An agent skill from ImCa0/just-laws.

    781 GitHub starsUsed in 14 repos~3.2k tokens
    Documents & OfficeAuto-check: notes
  • Gzh Design

    isjiamu/gzh-design-skill

    微信公众号文章排版引擎,将 Markdown 转换为可直接粘贴到公众号编辑器的 HTML。主题风格从 references/theme-index.md 注册的自定义主题库中选取,自动章节编号、关键词下划线标记、引言卡片、目录导航、代码块、图片/GIF、作者签名。支持 Markdown / Word(.docx) / PDF / 纯文本输入(非 Markdown…

    3.9k GitHub starsUsed in 1 repo~2.2k tokens
    Documents & OfficeAuto-check passed
  • GenOffice Document CLI

    genspark-ai/genoffice

    Creates, converts, reads and edits real pptx, xlsx, docx and PDF files locally through the genoffice command line.

    8.8k GitHub stars~19k tokensUpdated yesterday
    Documents & OfficeAuto-check passed
  • Translate Book

    deusyu/translate-book

    Translate books (PDF/DOCX/EPUB) into any language using parallel sub-agents.

    2.1k GitHub stars~5.5k tokensUpdated 13 days ago
    Documents & OfficeAuto-check: notes
  • Docsagent

    docsagent/docsagent

    Search and manage private, local document collections (PDF, PPTX, DOCX) offline.

    625 GitHub stars~834 tokensUpdated 9 days ago
    Documents & OfficeAuto-check passed
  • Markitdown

    jimmc414/Kosmos

    Convert various file formats (PDF, Office documents, images, audio, web content, structured data) to Markdown optimized for LLM processing.

    594 GitHub starsUsed in 2 repos~1.7k tokens
    Documents & OfficeAuto-check passed

More from OpenLoaf/OpenLoaf

All 34 skills in this repo
  • Agent Orchestration Skill

    OpenLoaf/OpenLoaf

    Triggers when the master Agent faces a multi-step complex task and is deciding whether / how to outsource sub-tasks to built-in subagents (browser / doc-editor / data-analyst / extractor /…

    107 GitHub stars~1.9k tokensUpdated 4 mo ago
    Auto-check passed
  • Browser Ops Skill

    OpenLoaf/OpenLoaf

    Triggered when the user asks for page-level interaction with a specific webpage: login, form filling, button clicks, pagination scraping, screenshots, downloading page images, handling CAPTCHAs or…

    107 GitHub stars~1.5k tokensUpdated 4 mo ago
    Auto-check passed
  • Canvas Ops Skill

    OpenLoaf/OpenLoaf

    Triggered when the user wants lifecycle management of OpenLoaf canvases / whiteboards: create, open, filter, duplicate, delete, rename, or change ownership.

    107 GitHub stars~1.4k tokensUpdated 4 mo ago
    Auto-check passed
  • Reads, edits, converts and reviews Word documents through three dedicated tools, covering tracked changes, comments, tables, images and format conversion.

    107 GitHub stars~1.9k tokensUpdated 4 mo ago
    Auto-check passed
  • Email Operations

    OpenLoaf/OpenLoaf

    Handles a real email account through query and mutate tools: check the inbox, read, search, reply, forward, compose and organize, with sending always confirmed first.

    107 GitHub stars~1.8k tokensUpdated 4 mo ago
    Auto-check passed
  • macOS Desktop Control

    OpenLoaf/OpenLoaf

    Guides an agent to operate native macOS apps by surveying an app first, acting through intents, menus or keystrokes, and verifying each step, in OpenLoaf Desktop only.

    107 GitHub stars~2.4k tokensUpdated 4 mo ago
    Auto-check passed

Works with

Questions about PDF Skill

What does PDF Skill do?

PDF 读/写/转/OCR 一体化。触发场景:总结 PDF、读文本或表格、填 AcroForm 表单、渲染页面为图、合并/拆分/水印/旋转/加密、创建新 PDF(发票/报告)、PDF ↔ docx/md/txt 互转。典型说法:“总结这份 PDF”、“填一下这个 PDF 表单”、“把几个 PDF 合一起”、“PDF 加水印”、“PDF 转 Word”、“扫描件 OCR”、“看看 PDF 第 3…. PDF Skill is an agent skill from OpenLoaf/OpenLoaf.

When should I use PDF Skill?

PDF Skill fits situations like: tasks that involve PDF; tasks that involve Word documents.

How do I install PDF Skill in Claude Code?

Run `npx skills add OpenLoaf/OpenLoaf --skill pdf-skill -a claude-code`. Or copy the skill folder (apps/server/src/ai/builtin-skills/pdf in OpenLoaf/OpenLoaf) into .claude/skills/pdf-skill in your project. Claude Code loads it when a task matches its description.

How do I install PDF Skill in Codex?

Run `npx skills add OpenLoaf/OpenLoaf --skill pdf-skill -a codex`. Or copy the skill folder (apps/server/src/ai/builtin-skills/pdf in OpenLoaf/OpenLoaf) into .agents/skills/pdf-skill in your project. Codex loads it when a task matches its description.

Can I use PDF Skill in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add OpenLoaf/OpenLoaf --skill pdf-skill -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pdf-skill, .gemini/skills/pdf-skill, .github/skills/pdf-skill and .opencode/skills/pdf-skill in your project.

What does PDF Skill need to run?

SKILL.md names no scripts, command-line tools or credentials: PDF Skill is instructions for the agent only.

Does PDF Skill access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is PDF Skill safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does PDF Skill use?

PDF Skill is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does PDF Skill use?

About 1.5k tokens (SKILL.md is roughly 6.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to PDF Skill?

Skills that share tags, products or a category with PDF Skill: Markitdown (ImCa0/just-laws, 781 stars), Gzh Design (isjiamu/gzh-design-skill, 3.9k stars), GenOffice Document CLI (genspark-ai/genoffice, 8.8k stars) and Translate Book (deusyu/translate-book, 2.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains PDF Skill?

OpenLoaf (a GitHub organization) maintains it in OpenLoaf/OpenLoaf, which has 107 GitHub stars. The repository holds 34 skills in this directory. The repository was last updated on May 14, 2026.

Source: OpenLoaf/OpenLoaf on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.