Files
SnapOtter/apps/docs/zh-CN/tools/pdf/redact-pdf.md
T
SnapOtterandGitHub 4963ab3bbd feat(docs-i18n): translate all documentation into 20 languages
All 181 docs markdown files translated into 20 languages (apps/docs/<locale>/**). Companion to the i18n code PR; admin-merged because the file count exceeds GitHub's per-PR CI trigger limit. Validated by pnpm i18n:check (all surfaces, 0 stale/missing) and a clean all-locale docs build.
2026-07-11 13:52:47 +08:00

1.7 KiB

description, i18n_source_hash, i18n_provenance, i18n_output_hash
description i18n_source_hash i18n_provenance i18n_output_hash
从 PDF 中永久移除指定的文本(经验证的真正涂黑)。 296ad2a701b2 human bba620b6691d

Redact PDF

使用经验证的真正涂黑从 PDF 中永久移除指定的文本。被涂黑的文本会从文件中彻底移除,而不仅仅是被黑框覆盖。

API Endpoint

POST /api/v1/tools/pdf/redact-pdf

接受包含一个 PDF 文件和一个 JSON settings 字段的 multipart 表单数据。

Parameters

Parameter Type Required Default Description
terms string[] Yes - 要涂黑的文本字符串(1-50 个词条,每个最多 200 个字符)
caseSensitive boolean No false 匹配是否区分大小写

Example Request

curl -X POST http://localhost:1349/api/v1/tools/pdf/redact-pdf \
  -H "Authorization: Bearer si_your-api-key" \
  -F "file=@contract.pdf" \
  -F 'settings={"terms": ["John Doe", "555-0123"], "caseSensitive": false}'

Example Response

{
  "jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "downloadUrl": "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/contract.pdf",
  "originalSize": 245000,
  "processedSize": 243000,
  "found": 7
}

Notes

  • 接受的输入格式:.pdf
  • 这是一个快速(同步)工具,直接返回结果。
  • 这会执行真正的涂黑:匹配到的文本会从 PDF 内容流中移除,而不仅仅是在视觉上遮盖。
  • 响应中的 found 字段表示涂黑了多少处。
  • 单次请求最多可涂黑 50 个词条。