搜索

PythonReactSEOPDF
OpenClaw

pdf-contract-redactor

PDF contract redaction tool. Use when the user needs to redact sensitive information from scanned PDF contracts. The tool performs OCR to extract text, identifies field names and their corresponding values, and redacts only the values while keeping field names visible. Supports Alibaba Cloud OCR API for accurate Chinese text recognition.

chayjan0 来源安装数☆ 0 仓库 Stars

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

SkillHub CLI

skillhub install chayjan/pdf-contract-redactor

打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。

将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。

查看来源 ↗使用指南

技能说明

PDF Contract Redactor

Redact sensitive values from scanned PDF contracts while preserving field names.

What It Does

  1. OCR Recognition: Uses Alibaba Cloud OCR to extract text and positions from scanned PDFs
  2. Field-Value Matching: Finds field names (e.g., "合同金额") and their corresponding values (e.g., "45640元")
  3. Selective Redaction: Covers only the values with black boxes, keeping field names readable

Workflow

Step 1: PDF to Images

Convert PDF pages to high-resolution PNG images (200 DPI) for OCR.

Step 2: OCR with Alibaba Cloud

Call Alibaba Cloud OCR API to get:

  • All text blocks
  • Bounding box coordinates for each text block
  • Confidence scores
Step 3: Match Fields to Values

For each field in the field list:

  1. Find the field name text block
  2. Look for the corresponding value in:
    • Right side: Same row, to the right of field name
    • Below: Next row, aligned with field name
  3. Record field-value pair with both bounding boxes
Step 4: Generate Redacted PDF

For each matched value:

  1. Convert image coordinates to PDF coordinates
  2. Draw black rectangle over the value area
  3. Keep field name area unchanged

Field List

The following fields are searched and their values are redacted:

  • 法务部归档编号, 归档时间, 申请人工号, 申请人姓名, 申请人部门
  • 申请人部门负责人, 所涉项目名称(如有), 所涉项目编号(如有)
  • 对方编号(如有), 合同编号, 合同名称, 合同甲方名称, 合同乙方名称
  • 合同相对方, 相对方所属行业, 相对方是否为世界500强
  • 相对方是央企/国企, 相对方是否为涉密单位, 业务类别, 合同类别
  • 合同类型, 合同状态, 扫描件状态, 对方是否签章, 我方是否签章
  • 销售、采购标的(非一起译填), 语种, 单价, 合同金额(元), 币种
  • 支付/收款方式, 付款/收款条件, 合同结算周期, 是否使用公司模板
  • 用章主体, 印章类型, 签订时间, 合同开始时间, 合同到期时间
  • 收支类型, 我方联系人姓名, 我方联系人电话, 对方联系人姓名
  • 对方联系人电话, 对方邮寄地址, 归档状态, 开票名称, 开票账号
  • 开票银行, 收款名称, 收款账号, 收款银行, 验收时间, 验收标...

来源信息

Source
github
Repository
openclaw/skills
Path
skills/chayjan/pdf-contract-redactor
Version
—
Commit
aee9443ee19e7a7fc2411e9ed569624521109456
分类来源
rules
状态
active
可见性
public

这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。

来源内容

SKILL.md
# PDF Contract Redactor

Redact sensitive values from scanned PDF contracts while preserving field names.

## What It Does

1. **OCR Recognition**: Uses Alibaba Cloud OCR to extract text and positions from scanned PDFs
2. **Field-Value Matching**: Finds field names (e.g., "合同金额") and their corresponding values (e.g., "45640元")
3. **Selective Redaction**: Covers only the values with black boxes, keeping field names readable

## Workflow

### Step 1: PDF to Images
Convert PDF pages to high-resolution PNG images (200 DPI) for OCR.

### Step 2: OCR with Alibaba Cloud
Call Alibaba Cloud OCR API to get:
- All text blocks
- Bounding box coordinates for each text block
- Confidence scores

### Step 3: Match Fields to Values
For each field in the field list:
1. Find the field name text block
2. Look for the corresponding value in:
   - **Right side**: Same row, to the right of field name
   - **Below**: Next row, aligned with field name
3. Record field-value pair with both bounding boxes

### Step 4: Generate Redacted PDF
For each matched value:
1. Convert image coordinates to PDF coordinates
2. Draw black rectangle over the value area
3. Keep field name area unchanged

## Field List

The following fields are searched and their values are redacted:

- 法务部归档编号, 归档时间, 申请人工号, 申请人姓名, 申请人部门
- 申请人部门负责人, 所涉项目名称(如有), 所涉项目编号(如有)
- 对方编号(如有), 合同编号, 合同名称, 合同甲方名称, 合同乙方名称
- 合同相对方, 相对方所属行业, 相对方是否为世界500强
- 相对方是央企/国企, 相对方是否为涉密单位, 业务类别, 合同类别
- 合同类型, 合同状态, 扫描件状态, 对方是否签章, 我方是否签章
- 销售、采购标的(非一起译填), 语种, 单价, 合同金额(元), 币种
- 支付/收款方式, 付款/收款条件, 合同结算周期, 是否使用公司模板
- 用章主体, 印章类型, 签订时间, 合同开始时间, 合同到期时间
- 收支类型, 我方联系人姓名, 我方联系人电话, 对方联系人姓名
- 对方联系人电话, 对方邮寄地址, 归档状态, 开票名称, 开票账号
- 开票银行, 收款名称, 收款账号, 收款银行, 验收时间, 验收标...

相关技能

OpenClaw

x402hub

capncoconut

Register, communicate, and earn on the x402hub AI agent marketplace. Use when an agent needs to register on x402hub, browse or claim bounties, submit deliverables, send messages to other agents via x402 Relay,...

OpenClaw

claw

capevace

Real-time event bus for AI agents. Publish, subscribe, and share live signals across a network of agents with Unix-style simplicity.

OpenClaw

captchas-openclaw

captchasco

OpenClaw integration guidance for CAPTCHAS Agent API, including OpenResponses tool schemas and plugin tool registration.