当前位置: 首页 > Skill >

Nutrient Document Processing (Universal Agent Skill)

Nutrient Document Processing (Universal Agent Skill)

Nutrient Document Processing (Universal Agent Skill)

适用于兼容 Agent Skills 产品的通用(非 OpenClaw)Nutrient DWS 文档处理技能。最佳搭配:Claude Code、Codex CLI、Gemini CLI、Cursor、Wi...

1.1.2 2026.11.23 323
获取Skill文件查看使用说明
作 者:许知 许可证: 更新时间:2026.11.23
本文目录展开

Nutrient Document Processing (Universal Agent Skill)

Best for Claude Code/Codex/Gemini/Cursor/Windsurf and other non-OpenClaw agents. Process, convert, extract, OCR, redact, sign, and manipulate documents using the Nutrient DWS Processor API.

Setup

You need a Nutrient DWS API key. Get one free at https://dashboard.nutrient.io/sign_up/?product=processor.

Option 1: MCP Server (Recommended)

If your agent supports MCP (Model Context Protocol), use the Nutrient DWS MCP Server. It provides all operations as native tools.

Configure your MCP client (e.g., claude_desktop_config.json or .mcp.json):

{
  "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"
      }
    }
  }
}

Then use the MCP tools directly (e.g., convert_to_pdf, extract_text, redact, etc.).

Option 2: Direct API (curl)

For agents without MCP support, call the API directly:

export NUTRIENT_API_KEY="your_api_key_here"

All requests go to https://api.nutrient.io/build as multipart POST with an instructions JSON field.

Safety Boundaries

  • This skill sends documents to the Nutrient DWS API (api.nutrient.io) for processing. Documents may contain sensitive data — ensure your Nutrient account's data handling policies are acceptable.
  • It does NOT access local files beyond those explicitly passed for processing.
  • It does NOT store API keys or credentials beyond the current session.
  • MCP server mode (npx @nutrient-sdk/dws-mcp-server) downloads the official Nutrient MCP server package from npm at runtime.
  • All API calls require an explicit API key — no anonymous access is possible.

Operations

1. Convert Documents

Convert between PDF, DOCX, XLSX, PPTX, HTML, and image formats.

HTML to 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

DOCX to 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 to DOCX/XLSX/PPTX:

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

Image to PDF:

curl -X POST https://api.nutrient.io/build 
  -H "Authorization: Bearer $NUTRIENT_API_KEY" 
  -F "image.jpg=@image.jpg" 
  -F 'instructions={"parts":[{"file":"image.jpg"}]}' 
  -o output.pdf

2. Extract Text and Data

Extract plain text:

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

Extract tables (as JSON, CSV, or 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

Extract key-value pairs:

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":"extraction","strategy":"key-values"}]}' 
  -o result.json

3. OCR Scanned Documents

Apply OCR to scanned PDFs or images, producing searchable PDFs with selectable text.

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

Supported languages: english, german, french, spanish, italian, portuguese, dutch, swedish, danish, norwegian, finnish, polish, czech, turkish, japanese, korean, chinese-simplified, chinese-traditional, arabic, hebrew, thai, hindi, russian, and more.

4. Redact Sensitive Information

Pattern-based redaction (preset patterns):

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","preset":"social-security-number"}]}' 
  -o redacted.pdf

Available presets: social-security-number, credit-card-number, email-address, north-american-phone-number, international-phone-number, date, url, ipv4, ipv6, mac-address, us-zip-code, vin, time.

Regex-based redaction:

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","regex":"\b[A-Z]{2}\d{6}\b"}]}' 
  -o redacted.pdf

AI-powered PII redaction:

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":"ai_redaction","criteria":"All personally identifiable information"}]}' 
  -o redacted.pdf

The criteria field accepts natural language (e.g., "Names and phone numbers", "Protected health information", "Financial account numbers").

5. Add Watermarks

Text watermark:

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":48,"fontColor":"#FF0000","opacity":0.5,"rotation":45,"width":"50%","height":"50%"}]}' 
  -o watermarked.pdf

Image watermark:

curl -X POST https://api.nutrient.io/build 
  -H "Authorization: Bearer $NUTRIENT_API_KEY" 
  -F "document.pdf=@document.pdf" 
  -F "logo.png=@logo.png" 
  -F 'instructions={"parts":[{"file":"document.pdf"}],"actions":[{"type":"watermark","imagePath":"logo.png","width":"30%","height":"30%","opacity":0.3}]}' 
  -o watermarked.pdf

6. Digital Signatures

Sign a PDF with CMS signature:

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","signerName":"John Doe","reason":"Approval","location":"New York"}]}' 
  -o signed.pdf

Sign with CAdES-B-LT (long-term validation):

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":"cades","cadesLevel":"b-lt","signerName":"Jane Smith"}]}' 
  -o signed.pdf

7. Form Filling (Instant JSON)

Fill PDF form fields using Instant JSON format:

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","fields":[{"name":"firstName","value":"John"},{"name":"lastName","value":"Doe"},{"name":"email","value":"john@example.com"}]}]}' 
  -o filled.pdf

8. Merge and Split PDFs

Merge multiple PDFs:

curl -X POST https://api.nutrient.io/build 
  -H "Authorization: Bearer $NUTRIENT_API_KEY" 
  -F "doc1.pdf=@doc1.pdf" 
  -F "doc2.pdf=@doc2.pdf" 
  -F 'instructions={"parts":[{"file":"doc1.pdf"},{"file":"doc2.pdf"}]}' 
  -o merged.pdf

Extract specific pages:

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","pages":{"start":0,"end":4}}]}' 
  -o pages1-5.pdf

9. Render PDF Pages as Images

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","pages":{"start":0,"end":0}}],"output":{"type":"png","dpi":300}}' 
  -o page1.png

10. Check Credits

curl -X GET https://api.nutrient.io/credits 
  -H "Authorization: Bearer $NUTRIENT_API_KEY"

Best Practices

  1. Use the MCP server when your agent supports it — it handles file I/O, error handling, and sandboxing automatically.
  2. Set SANDBOX_PATH to restrict file access to a specific directory.
  3. Check credit balance before batch operations to avoid interruptions.
  4. Use AI redaction for complex PII detection; use preset/regex redaction for known patterns (faster, cheaper).
  5. Chain operations — the API supports multiple actions in a single call (e.g., OCR then redact).

Troubleshooting

Issue Solution
401 Unauthorized Check your API key is valid and has credits
413 Payload Too Large Files must be under 100 MB
Slow AI redaction AI analysis takes 60–120 seconds; this is normal
OCR quality poor Try a different language parameter or improve scan quality
Missing text in extraction Run OCR first on scanned documents

More Information

  • Full API reference — Detailed endpoints, parameters, and error codes
  • API Playground — Interactive API testing
  • API Documentation — Official guides
  • MCP Server repo — Source code and issues

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,019
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,014
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,013
Skill 文件
  • SKILL.md
    • Nutrient Document Processing (Universal Agent Skill)
    • Setup
      • Option 1: MCP Server (Recommended)
      • Option 2: Direct API (curl)
    • Safety Boundaries
    • Operations
      • 1. Convert Documents
      • 2. Extract Text and Data
      • 3. OCR Scanned Documents
      • 4. Redact Sensitive Information
      • 5. Add Watermarks
      • 6. Digital Signatures
      • 7. Form Filling (Instant JSON)
      • 8. Merge and Split PDFs
      • 9. Render PDF Pages as Images
      • 10. Check Credits
    • Best Practices
    • Troubleshooting
    • More Information
  • 项目或源文件

相关 Skill

更多
Upstage Studio Upstage Studio Run document processing workflows using Upstage Document Agent API (v2) — both Studio-UI-configured agents (`agt_xxx`) and programmatically defined Agents/Co...
Nexus Agent Framework 🔮 Nexus Agent Framework 🔮 安全優先的通用 Agent 工作框架 | Secure Universal Agent Framework - 自動知識索引、創意建議、關聯系統
TDOC Docx TDOC Docx Word 文档全能处理技能 | Complete Word Document Processing Skill. 支持创建、读取、编辑、转换 Word 文档 | Create, read, edit, convert Word documents. 支持 .docx/.doc 格式、中文公文格式、表格、图片、tr...
Universal Agent Universal Agent >极简万能通用AI Agent,只保留了SKILL.MD文件采用模拟模式。
md-converter-en md-converter-en >A local document processing tool supporting bidirectional conversion across 8 formats including Markdown, PDF, Word, HTML, and plain text, with full support for Chinese, English, Japanese, and Korean.