Agent skill
nutrient-document-processing
使用 Nutrient DWS API 进行文档处理、转换、OCR、提取、脱敏、签名以及表单填充。支持 PDF、DOCX、XLSX、PPTX、HTML 和图像格式。
Install this agent skill to your Project
npx add-skill https://github.com/xu-xiang/everything-claude-code-zh/tree/main/docs/ja-JP/skills/nutrient-document-processing
SKILL.md
Nutrient 文档处理 (Document Processing)
使用 Nutrient DWS 处理程序 API (Processor API) 处理文档。它可以进行格式转换、文本与表格提取、扫描文档的光学字符识别 (OCR)、个人身份信息 (PII) 脱敏、添加水印、数字签名以及 PDF 表单填充。
设置 (Setup)
请在 nutrient.io 获取免费的 API 密钥。
export NUTRIENT_API_KEY="pdf_live_..."
所有请求都以多部分 POST (multipart POST) 的形式发送到 https://api.nutrient.io/build,其中包含 instructions JSON 字段。
操作 (Operations)
文档转换
# 从 DOCX 转换为 PDF
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "document.docx=@document.docx" \
-F 'instructions={"parts":[{"file":"document.docx"}]}' \
-o output.pdf
# 从 PDF 转换为 DOCX
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "document.pdf=@document.pdf" \
-F 'instructions={"parts":[{"file":"document.pdf"}],"output":{"type":"docx"}}' \
-o output.docx
# 从 HTML 转换为 PDF
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "index.html=@index.html" \
-F 'instructions={"parts":[{"html":"index.html"}]}' \
-o output.pdf
支持的输入格式:PDF、DOCX、XLSX、PPTX、DOC、XLS、PPT、PPS、PPSX、ODT、RTF、HTML、JPG、PNG、TIFF、HEIC、GIF、WebP、SVG、TGA、EPS。
文本与数据提取
# 提取纯文本
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "document.pdf=@document.pdf" \
-F 'instructions={"parts":[{"file":"document.pdf"}],"output":{"type":"text"}}' \
-o output.txt
# 将表格提取为 Excel
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "document.pdf=@document.pdf" \
-F 'instructions={"parts":[{"file":"document.pdf"}],"output":{"type":"xlsx"}}' \
-o tables.xlsx
扫描文档的 OCR
# 对扫描件进行 OCR 并生成可搜索的 PDF(支持 100 多种语言)
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "scanned.pdf=@scanned.pdf" \
-F 'instructions={"parts":[{"file":"scanned.pdf"}],"actions":[{"type":"ocr","language":"english"}]}' \
-o searchable.pdf
语言:通过 ISO 639-2 代码支持 100 多种语言(例如:eng、deu、fra、spa、jpn、kor、chi_sim、chi_tra、ara、hin、rus)。完整语言名称如 english 或 german 也可使用。有关所有受支持的代码,请参阅 完整 OCR 语言列表。
敏感信息脱敏 (Redaction)
# 基于模式(社会安全号码 SSN、电子邮件)
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "document.pdf=@document.pdf" \
-F 'instructions={"parts":[{"file":"document.pdf"}],"actions":[{"type":"redaction","strategy":"preset","strategyOptions":{"preset":"social-security-number"}},{"type":"redaction","strategy":"preset","strategyOptions":{"preset":"email-address"}}]}' \
-o redacted.pdf
# 基于正则表达式
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "document.pdf=@document.pdf" \
-F 'instructions={"parts":[{"file":"document.pdf"}],"actions":[{"type":"redaction","strategy":"regex","strategyOptions":{"regex":"\\b[A-Z]{2}\\d{6}\\b"}}]}' \
-o redacted.pdf
预设 (Presets):social-security-number、email-address、credit-card-number、international-phone-number、north-american-phone-number、date、time、url、ipv4、ipv6、mac-address、us-zip-code、vin。
添加水印 (Watermarking)
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "document.pdf=@document.pdf" \
-F 'instructions={"parts":[{"file":"document.pdf"}],"actions":[{"type":"watermark","text":"CONFIDENTIAL","fontSize":72,"opacity":0.3,"rotation":-45}]}' \
-o watermarked.pdf
数字签名 (Digital Signatures)
# 自签名 CMS 签名
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "document.pdf=@document.pdf" \
-F 'instructions={"parts":[{"file":"document.pdf"}],"actions":[{"type":"sign","signatureType":"cms"}]}' \
-o signed.pdf
PDF 表单填充 (Form Filling)
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "form.pdf=@form.pdf" \
-F 'instructions={"parts":[{"file":"form.pdf"}],"actions":[{"type":"fillForm","formFields":{"name":"Jane Smith","email":"jane@example.com","date":"2026-02-06"}}]}' \
-o filled.pdf
MCP 服务端 (代替方案)
对于原生工具集成,使用 MCP 服务端 (MCP Server) 代替 curl:
{
"mcpServers": {
"nutrient-dws": {
"command": "npx",
"args": ["-y", "@nutrient-sdk/dws-mcp-server"],
"env": {
"NUTRIENT_DWS_API_KEY": "YOUR_API_KEY",
"SANDBOX_PATH": "/path/to/working/directory"
}
}
}
}
使用场景
- 不同格式间的文档转换(PDF、DOCX、XLSX、PPTX、HTML、图像)
- 从 PDF 提取文本、表格和键值对
- 对扫描文档或图像进行 OCR
- 在共享文档前对 PII 进行脱敏
- 在草案或机密文档中添加水印
- 对合同或协议进行数字签名
- 以编程方式填充 PDF 表单
相关链接
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
investor-materials
创建并更新路演 PPT (Pitch Deck)、单页简介 (One-Pager)、投资者备忘录 (Investor Memo)、加速器申请、财务模型以及融资材料。当用户需要面向投资者的文档、预测、资金用途表、里程碑计划或需要跨多个融资资产保持内部一致性的材料时,请使用此技能。
e2e-testing
Playwright E2E 测试模式、页面对象模型(POM)、配置、CI/CD 集成、产物管理以及不稳定测试(flaky test)策略。
api-design
生产级 API 的 REST API 设计模式,包括资源命名、状态码、分页、过滤、错误响应、版本控制和速率限制。
frontend-patterns
React、Next.js、状态管理(State Management)、性能优化(Performance Optimization)及 UI 最佳实践的前端开发模式。
investor-outreach
Draft cold emails, warm intro blurbs, follow-ups, update emails, and investor communications for fundraising. Use when the user wants outreach to angels, VCs, strategic investors, or accelerators and needs concise, personalized, investor-facing messaging.
verification-loop
为 Claude Code 会话提供的全面验证系统。
Didn't find tool you were looking for?