{"id":"c231af74-fa10-446a-8d9a-0cb5f43e13d9","entityType":"agent","slug":"clawhub-openclawzhangchong-pdf-ocr-zc","name":"pdf-ocr-byzhangchong","canonicalUrl":"https://www.xpersona.co/agent/clawhub-openclawzhangchong-pdf-ocr-zc","canonicalPath":"/agent/clawhub-openclawzhangchong-pdf-ocr-zc","generatedAt":"2026-10-13T11:39:16.348Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-11T22:40:33.896Z","emptyReason":null},"description":"批量 OCR 处理扫描 PDF，自动生成带文字层的 PDF 并可导出为 Markdown/纯文本。使用场景包括老师 Agent 需要将大量扫描教材 PDF 转化为可检索文本。 Skill: pdf-ocr-byzhangchong Owner: openclawzhangchong Summary: 批量 OCR 处理扫描 PDF，自动生成带文字层的 PDF 并可导出为 Markdown/纯文本。使用场景包括老师 Agent 需要将大量扫描教材 PDF 转化为可检索文本。 Tags: latest:1.0.0 Version history: v1.0.0 | 2026-04-18T04:02:20.024Z | user - 初始版本发布：支持批量 OCR 处理扫描 PDF，生成可搜索文字层或导出为纯文本/Markdown。 - 脚本自动检测 ocrmypdf 环境，支持单文件和批量目录处理。 - 错误日志自动保存，便于问题排查。 - 适用于老师 Agent自动化教材 PDF 转文本的场景。 - 提供详细安装及参数调优参考文档。 Archive index: Archive v1.0.0: 6 fi","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 983 downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s178cqx9kma3mpnvqe8evteyr983hvb4:pdf-ocr-zc","sourceUrl":"https://clawhub.ai/openclawzhangchong/pdf-ocr-zc","homepage":"https://clawhub.ai/openclawzhangchong/skills/pdf-ocr-zc","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/openclawzhangchong/pdf-ocr-zc","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/openclawzhangchong/skills/pdf-ocr-zc","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":60,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"批量 OCR 处理扫描 PDF，自动生成带文字层的 PDF 并可导出为 Markdown/纯文本。使用场景包括老师 Agent 需要将大量扫描教材 PDF 转化为可检索文本。 Skill: pdf-ocr-byzhangchong Owner: openclawzhangchong Summary: 批量 OCR 处理"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T22:40:33.896Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T22:40:33.896Z","emptyReason":null},"stars":null,"forks":null,"downloads":983,"likes":null,"task":null,"library":null,"packageName":null,"latestVersion":"1.0.0","tractionLabel":"983 downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T22:40:33.830Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T22:40:33.896Z","lastCrawledAt":"2026-10-11T22:40:33.830Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T22:40:33.830Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.0","createdAt":"2026-04-18T04:02:20.024Z","changelog":"- 初始版本发布：支持批量 OCR 处理扫描 PDF，生成可搜索文字层或导出为纯文本/Markdown。 - 脚本自动检测 ocrmypdf 环境，支持单文件和批量目录处理。 - 错误日志自动保存，便于问题排查。 - 适用于老师 Agent自动化教材 PDF 转文本的场景。 - 提供详细安装及参数调优参考文档。","fileCount":6,"zipByteSize":5765}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s178cqx9kma3mpnvqe8evteyr983hvb4:pdf-ocr-zc","setupComplexity":"low","setupSteps":["Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-openclawzhangchong-pdf-ocr-zc/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-openclawzhangchong-pdf-ocr-zc/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-openclawzhangchong-pdf-ocr-zc/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-openclawzhangchong-pdf-ocr-zc/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-openclawzhangchong-pdf-ocr-zc/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-openclawzhangchong-pdf-ocr-zc/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-13T11:39:16.347Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-openclawzhangchong-pdf-ocr-zc/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-openclawzhangchong-pdf-ocr-zc/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-openclawzhangchong-pdf-ocr-zc/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-openclawzhangchong-pdf-ocr-zc/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-11T22:40:33.896Z","emptyReason":null},"readme":"Skill: pdf-ocr-byzhangchong\n\nOwner: openclawzhangchong\n\nSummary: 批量 OCR 处理扫描 PDF，自动生成带文字层的 PDF 并可导出为 Markdown/纯文本。使用场景包括老师 Agent 需要将大量扫描教材 PDF 转化为可检索文本。\n\nTags: latest:1.0.0\n\nVersion history:\n\nv1.0.0 | 2026-04-18T04:02:20.024Z | user\n\n- 初始版本发布：支持批量 OCR 处理扫描 PDF，生成可搜索文字层或导出为纯文本/Markdown。\n- 脚本自动检测 ocrmypdf 环境，支持单文件和批量目录处理。\n- 错误日志自动保存，便于问题排查。\n- 适用于老师 Agent自动化教材 PDF 转文本的场景。\n- 提供详细安装及参数调优参考文档。\n\nArchive index:\n\nArchive v1.0.0: 6 files, 5765 bytes\n\nFiles: references/install_ocr.md (1143b), references/ocr_tips.md (923b), scripts/ocr_batch.py (2292b), skill-card.md (2138b), SKILL.md (2399b), _meta.json (129b)\n\nFile v1.0.0:SKILL.md\n\n---\nname: pdf-ocr-zc\ndescription: 批量 OCR 处理扫描 PDF，自动生成带文字层的 PDF 并可导出为 Markdown/纯文本。使用场景包括老师 Agent 需要将大量扫描教材 PDF 转化为可检索文本。\n---\n\n# PDF OCR 处理技能\n\n## 何时使用\n- 需要对大量扫描件 PDF 进行文字识别（OCR）\n- 希望直接得到可搜索的 PDF（文字层）或提取的纯文本/Markdown\n- 需要在老师 Agent 工作流中自动化该步骤\n\n## 基本使用方式\n```bash\n# 运行一次 OCR（需要已安装 Tesseract 与 ocrmypdf）\nopenclaw exec python skills/pdf-ocr/scripts/ocr_batch.py <input-pdf> <output-pdf>\n```\n- `<input-pdf>`：原始扫描 PDF 路径\n- `<output-pdf>`：输出带文字层的 PDF（同目录或指定路径）\n\n## 高级选项\n- 若想一次性处理目录下所有 PDF，使用 `--batch-dir` 参数：\n```bash\nopenclaw exec python skills/pdf-ocr/scripts/ocr_batch.py --batch-dir <pdf-dir>\n```\n- 可加 `--lang chi_sim` 指定中文简体模型（默认 tesseract 会自动检测语言）\n\n## 脚本说明 (scripts/ocr_batch.py)\n- 检测并确保 `ocrmypdf` 可用；如未安装会提示安装指令\n- 使用 `ocrmypdf` 完成 OCR，内部调用已装好的 Tesseract\n- 支持批量目录模式，遍历 `*.pdf` 并生成对应带文字层文件\n- 错误会记录到 `logs/pdf_ocr_error.log`，便于排查\n\n## 参考资源\n- `references/ocr_tips.md`：常见 OCR 参数调优技巧（如 DPI、图片预处理）\n- `references/install_ocr.md`：在 Windows 上安装 Tesseract 与 ocrmypdf 的详细步骤\n\n## 与老师 Agent 的集成\n在老师 Agent 的工作流（如 `auto_ingest`）中，可在 `HEARTBEAT.md` 或 cron 中加入如下调用，以实现每日自动 OCR：\n```bash\nopenclaw exec python skills/pdf-ocr/scripts/ocr_batch.py --batch-dir /path/to/teacher-pdfs\n```\n这样老师 Agent 在 ingest 前就已拥有文字层，后续向量化、检索都能顺畅进行。\n\n---\n\n# 使用示例\n1. 单文件 OCR：\n```bash\nopenclaw exec python skills/pdf-ocr/scripts/ocr_batch.py D:\\docs\\scan1.pdf D:\\docs\\scan1_text.pdf\n```\n2. 批量目录 OCR：\n```bash\nopenclaw exec python skills/pdf-ocr/scripts/ocr_batch.py --batch-dir D:\\teacher-pdfs\n```\n\n如需更细粒度的文本（Markdown），可在脚本后接 `pdf2txt.py` 转换。\n\n---\n\n**注意**：此技能仅在本机执行，不会触发外部网络请求，符合安全策略。\n\nFile v1.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn79hrrjng9fn12qahyeksj8mx83g8bf\",\n  \"slug\": \"pdf-ocr-zc\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1776484940024\n}\n\nFile v1.0.0:references/install_ocr.md\n\n# 安装 Tesseract 与 ocrmypdf（Windows）\n\n## 1. 安装 Tesseract\n1. 前往 https://github.com/UB-Mannheim/tesseract/wiki 下载对应 Windows 的 MSI 安装包（通常是 `tesseract‑5.3.1‑setup‑amd64.exe`）。\n2. 双击运行安装程序，保持默认路径（如 `C:\\Program Files\\Tesseract-OCR`），并在安装选项中勾选 **Add to PATH**。\n3. 安装完成后，打开 PowerShell，运行 `tesseract --version` 检查是否能正确输出版本信息。\n\n## 2. 安装 ocrmypdf（Python 包）\n```powershell\n# 建议使用 Python 3.10+（已在工作区安装）\npython -m pip install --upgrade pip\npip install ocrmypdf\n```\nocrmypdf 会自动调用已在 PATH 中的 Tesseract。\n\n## 3. 验证安装\n```powershell\nocrmypdf --version\n# 示例：对 test.pdf 生成带文字层的 PDF（仅作测试）\nocrmypdf test.pdf test_ocr.pdf\n```\n如果没有报错且生成了 `test_ocr.pdf`，说明已成功。\n\n如需其他语言模型（如繁体中文、英文），可以在 Tesseract 安装目录的 `tessdata` 文件夹中放入对应的 `.traineddata` 文件，或使用 `pip install ocrmypdf[all]` 以获取额外依赖。\n\nFile v1.0.0:references/ocr_tips.md\n\n# OCR 参数与技巧\n\n- **DPI（分辨率）**：默认 300 DPI 足够中文 OCR，若原始扫描分辨率低于 200，建议先用 `pdf2image` 提升 DPI 再 OCR。\n- **语言模型**：`-l chi_sim`（简体中文）或 `-l chi_tra`（繁体中文），可一次指定多个语言，如 `-l chi_sim+eng`。\n- **快速模式**：`--skip-text` 可跳过已有文字层的 PDF，避免重复 OCR，适合批处理。\n- **图片预处理**：若扫描噪点多，可使用 `--clean` 或 `--deskew` 参数让文字更清晰。\n- **错误日志**：ocrmypdf 会把错误写入 STDERR，建议在脚本中捕获并写入 `logs/pdf_ocr_error.log`，如本技能所示。\n- **并行**：`ocrmypdf` 本身不支持并行，但可以在脚本外层使用 `xargs -P` 或 PowerShell 并行调用实现多文件并发处理。\n\n以上技巧可在 `ocr_batch.py` 中通过 `--lang`、`--skip-text`、`--clean` 等参数自行扩展。\n\nFile v1.0.0:skill-card.md\n\n## Description:\n\nBatch OCR for scanned PDFs that creates searchable PDF outputs and can support downstream Markdown or plain-text extraction.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[openclawzhangchong](https://clawhub.ai/user/openclawzhangchong)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers, educators, and agent builders use this skill to OCR scanned PDF collections before indexing, retrieval, or document-ingestion workflows. It supports single-file processing and recursive batch processing with a configurable OCR language.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Recursive batch processing can create many local *_ocr.pdf outputs and logs.\n\nMitigation: Test on a small folder first, verify generated outputs, and avoid unattended scheduled use until the workflow is reviewed.\n\nRisk: The installation guidance depends on unpinned third-party OCR components.\n\nMitigation: Use a virtual environment and verify or pin dependency versions before production use.\n\nRisk: Incorrect OCR language settings can reduce text quality for scanned documents.\n\nMitigation: Select the correct OCR language with --lang and validate sample results before bulk processing.\n\n## Reference(s):\n\n- [OCR Installation Guide](references/install_ocr.md)\n- [OCR Parameters and Tips](references/ocr_tips.md)\n- [UB Mannheim Tesseract for Windows](https://github.com/UB-Mannheim/tesseract/wiki)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, Code, Shell commands, Configuration]\n\n**Output Format:** [Markdown guidance with shell commands and generated local PDF or text artifacts]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Processes local PDF paths supplied by the user and may create *_ocr.pdf files plus logs.]\n\n## Skill Version(s):\n\n1.0.0 (source: release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.","readmeExcerpt":"Skill: pdf-ocr-byzhangchong Owner: openclawzhangchong Summary: 批量 OCR 处理扫描 PDF，自动生成带文字层的 PDF 并可导出为 Markdown/纯文本。使用场景包括老师 Agent 需要将大量扫描教材 PDF 转化为可检索文本。 Tags: latest:1.0.0 Version history: v1.0.0 | 2026-04-18T04:02:20.024Z | user - 初始版本发布：支持批量 OCR 处理扫描 PDF，生成可搜索文字层或导出为纯文本/Markdown。 - 脚本自动检测 ocrmypdf 环境，支持单文件和批量目录处理。 - 错误日志自动保存，便于问题排查。 - 适用于老师 Agent自动化教材 PDF 转文本的场景。 - 提供详细安装及参数调优参考文档。 Archive index: Archive v1.0.0: 6 fi","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"# 运行一次 OCR（需要已安装 Tesseract 与 ocrmypdf）\nopenclaw exec python skills/pdf-ocr/scripts/ocr_batch.py <input-pdf> <output-pdf>"},{"language":"bash","snippet":"openclaw exec python skills/pdf-ocr/scripts/ocr_batch.py --batch-dir <pdf-dir>"},{"language":"bash","snippet":"openclaw exec python skills/pdf-ocr/scripts/ocr_batch.py --batch-dir /path/to/teacher-pdfs"},{"language":"bash","snippet":"openclaw exec python skills/pdf-ocr/scripts/ocr_batch.py D:\\docs\\scan1.pdf D:\\docs\\scan1_text.pdf"},{"language":"bash","snippet":"openclaw exec python skills/pdf-ocr/scripts/ocr_batch.py --batch-dir D:\\teacher-pdfs"},{"language":"powershell","snippet":"# 建议使用 Python 3.10+（已在工作区安装）\npython -m pip install --upgrade pip\npip install ocrmypdf"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: pdf-ocr-zc\ndescription: 批量 OCR 处理扫描 PDF，自动生成带文字层的 PDF 并可导出为 Markdown/纯文本。使用场景包括老师 Agent 需要将大量扫描教材 PDF 转化为可检索文本。\n---\n\n# PDF OCR 处理技能\n\n## 何时使用\n- 需要对大量扫描件 PDF 进行文字识别（OCR）\n- 希望直接得到可搜索的 PDF（文字层）或提取的纯文本/Markdown\n- 需要在老师 Agent 工作流中自动化该步骤\n\n## 基本使用方式\n```bash\n# 运行一次 OCR（需要已安装 Tesseract 与 ocrmypdf）\nopenclaw exec python skills/pdf-ocr/scripts/ocr_batch.py <input-pdf> <output-pdf>\n```\n- `<input-pdf>`：原始扫描 PDF 路径\n- `<output-pdf>`：输出带文字层的 PDF（同目录或指定路径）\n\n## 高级选项\n- 若想一次性处理目录下所有 PDF，使用 `--batch-dir` 参数：\n```bash\nopenclaw exec python skills/pdf-ocr/scripts/ocr_batch.py --batch-dir <pdf-dir>\n```\n- 可加 `--lang chi_sim` 指定中文简体模型（默认 tesseract 会自动检测语言）\n\n## 脚本说明 (scripts/ocr_batch.py)\n- 检测并确保 `ocrmypdf` 可用；如未安装会提示安装指令\n- 使用 `ocrmypdf` 完成 OCR，内部调用已装好的 Tesseract\n- 支持批量目录模式，遍历 `*.pdf` 并生成对应带文字层文件\n- 错误会记录到 `logs/pdf_ocr_error.log`，便于排查\n\n## 参考资源\n- `references/ocr_tips.md`：常见 OCR 参数调优技巧（如 DPI、图片预处理）\n- `references/install_ocr.md`：在 Windows 上安装 Tesseract 与 ocrmypdf 的详细步骤\n\n## 与老师 Agent 的集成\n在老师 Agent 的工作流（如 `auto_ingest`）中，可在 `HEARTBEAT.md` 或 cron 中加入如下调用，以实现每日自动 OCR：\n```bash\nopenclaw exec python skills/pdf-ocr/scripts/ocr_batch.py --batch-dir /path/to/teacher-pdfs\n```\n这样老师 Agent 在 ingest 前就已拥有文字层，后续向量化、检索都能顺畅进行。\n\n---\n\n# 使用示例\n1. 单文件 OCR：\n```bash\nopenclaw exec python skills/pdf-ocr/scripts/ocr_batch.py D:\\docs\\scan1.pdf D:\\docs\\scan1_text.pdf\n```\n2. 批量目录 OCR：\n```bash\nopenclaw exec python skills/pdf-ocr/scripts/ocr_batch.py --batch-dir D:\\teacher-pdfs\n```\n\n如需更细粒度的文本（Markdown），可在脚本后接 `pdf2txt.py` 转换。\n\n---\n\n**注意**：此技能仅在本机执行，不会触发外部网络请求，符合安全策略。"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn79hrrjng9fn12qahyeksj8mx83g8bf\",\n  \"slug\": \"pdf-ocr-zc\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1776484940024\n}"},{"path":"references/install_ocr.md","content":"# 安装 Tesseract 与 ocrmypdf（Windows）\n\n## 1. 安装 Tesseract\n1. 前往 https://github.com/UB-Mannheim/tesseract/wiki 下载对应 Windows 的 MSI 安装包（通常是 `tesseract‑5.3.1‑setup‑amd64.exe`）。\n2. 双击运行安装程序，保持默认路径（如 `C:\\Program Files\\Tesseract-OCR`），并在安装选项中勾选 **Add to PATH**。\n3. 安装完成后，打开 PowerShell，运行 `tesseract --version` 检查是否能正确输出版本信息。\n\n## 2. 安装 ocrmypdf（Python 包）\n```powershell\n# 建议使用 Python 3.10+（已在工作区安装）\npython -m pip install --upgrade pip\npip install ocrmypdf\n```\nocrmypdf 会自动调用已在 PATH 中的 Tesseract。\n\n## 3. 验证安装\n```powershell\nocrmypdf --version\n# 示例：对 test.pdf 生成带文字层的 PDF（仅作测试）\nocrmypdf test.pdf test_ocr.pdf\n```\n如果没有报错且生成了 `test_ocr.pdf`，说明已成功。\n\n如需其他语言模型（如繁体中文、英文），可以在 Tesseract 安装目录的 `tessdata` 文件夹中放入对应的 `.traineddata` 文件，或使用 `pip install ocrmypdf[all]` 以获取额外依赖。"},{"path":"references/ocr_tips.md","content":"# OCR 参数与技巧\n\n- **DPI（分辨率）**：默认 300 DPI 足够中文 OCR，若原始扫描分辨率低于 200，建议先用 `pdf2image` 提升 DPI 再 OCR。\n- **语言模型**：`-l chi_sim`（简体中文）或 `-l chi_tra`（繁体中文），可一次指定多个语言，如 `-l chi_sim+eng`。\n- **快速模式**：`--skip-text` 可跳过已有文字层的 PDF，避免重复 OCR，适合批处理。\n- **图片预处理**：若扫描噪点多，可使用 `--clean` 或 `--deskew` 参数让文字更清晰。\n- **错误日志**：ocrmypdf 会把错误写入 STDERR，建议在脚本中捕获并写入 `logs/pdf_ocr_error.log`，如本技能所示。\n- **并行**：`ocrmypdf` 本身不支持并行，但可以在脚本外层使用 `xargs -P` 或 PowerShell 并行调用实现多文件并发处理。\n\n以上技巧可在 `ocr_batch.py` 中通过 `--lang`、`--skip-text`、`--clean` 等参数自行扩展。"},{"path":"skill-card.md","content":"## Description:\n\nBatch OCR for scanned PDFs that creates searchable PDF outputs and can support downstream Markdown or plain-text extraction.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[openclawzhangchong](https://clawhub.ai/user/openclawzhangchong)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers, educators, and agent builders use this skill to OCR scanned PDF collections before indexing, retrieval, or document-ingestion workflows. It supports single-file processing and recursive batch processing with a configurable OCR language.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Recursive batch processing can create many local *_ocr.pdf outputs and logs.\n\nMitigation: Test on a small folder first, verify generated outputs, and avoid unattended scheduled use until the workflow is reviewed.\n\nRisk: The installation guidance depends on unpinned third-party OCR components.\n\nMitigation: Use a virtual environment and verify or pin dependency versions before production use.\n\nRisk: Incorrect OCR language settings can reduce text quality for scanned documents.\n\nMitigation: Select the correct OCR language with --lang and validate sample results before bulk processing.\n\n## Reference(s):\n\n- [OCR Installation Guide](references/install_ocr.md)\n- [OCR Parameters and Tips](references/ocr_tips.md)\n- [UB Mannheim Tesseract for Windows](https://github.com/UB-Mannheim/tesseract/wiki)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, Code, Shell commands, Configuration]\n\n**Output Format:** [Markdown guidance with shell commands and generated local PDF or text artifacts]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Processes local PDF paths supplied by the user and may create *_ocr.pdf files plus logs.]\n\n## Skill Version(s):\n\n1.0.0 (source: release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"批量 OCR 处理扫描 PDF，自动生成带文字层的 PDF 并可导出为 Markdown/纯文本。使用场景包括老师 Agent 需要将大量扫描教材 PDF 转化为可检索文本。 Skill: pdf-ocr-byzhangchong Owner: openclawzhangchong Summary: 批量 OCR 处理扫描 PDF，自动生成带文字层的 PDF 并可导出为 Markdown/纯文本。使用场景包括老师 Agent 需要将大量扫描教材 PDF 转化为可检索文本。 Tags: latest:1.0.0 Version history: v1.0.0 | 2026-04-18T04:02:20.024Z | user - 初始版本发布：支持批量 OCR 处理扫描 PDF，生成可搜索文字层或导出为纯文本/Markdown。 - 脚本自动检测 ocrmypdf 环境，支持单文件和批量目录处理。 - 错误日志自动保存，便于问题排查。 - 适用于老师 Agent自动化教材 PDF 转文本的场景。 - 提供详细安装及参数调优参考文档。 Archive index: Archive v1.0.0: 6 fi","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":789,"uniquenessScore":56,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T22:40:33.896Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-11T22:40:33.896Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-13T11:39:16.348Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}