{
  "schemaVersion": "1.0",
  "item": {
    "slug": "pdf-ocr-layout",
    "name": "pdf-ocr-layout",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/baokui/pdf-ocr-layout",
    "canonicalUrl": "https://clawhub.ai/baokui/pdf-ocr-layout",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/pdf-ocr-layout",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=pdf-ocr-layout",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "SKILL_zh.md",
      "script/glm_ocr_pipeline.py",
      "script/glm_understanding.py",
      "script/glm_ocr_extract.py"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/pdf-ocr-layout"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/pdf-ocr-layout",
    "agentPageUrl": "https://openagent3.xyz/skills/pdf-ocr-layout/agent",
    "manifestUrl": "https://openagent3.xyz/skills/pdf-ocr-layout/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/pdf-ocr-layout/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "GLM-OCR Multimodal Deep Analysis",
        "body": "This tool builds a high-precision document parsing pipeline: using GLM-OCR for layout element extraction, calling GLM-4.7 for logical interpretation of table data, and calling GLM-4.6V for multimodal visual interpretation of images and charts."
      },
      {
        "title": "Pipeline Implementation Architecture",
        "body": "This Skill consists of two core script stages, orchestrated through glm_ocr_pipeline.py:"
      },
      {
        "title": "1. Extraction Stage (scripts/glm_ocr_extract.py)",
        "body": "Core Model: GLM-OCR\nFunction: Responsible for physical layout analysis of documents\nOutput: Extract table HTML and clean to Markdown, automatically crop independent chart image files based on Bbox coordinates, and generate intermediate JSON containing full page reading order"
      },
      {
        "title": "2. Understanding Stage (scripts/glm_understanding.py)",
        "body": "Core Model: GLM-4.7 (text) / GLM-4.6V (visual)\nFunction: Responsible for deep semantic reasoning of content\nLogic:\n\nTables: Combine full text context, use GLM-4.7 to analyze business meaning of Markdown table data\nCharts: Combine full text context + cropped images, use GLM-4.6V for multimodal visual analysis"
      },
      {
        "title": "Command Line Invocation",
        "body": "# Run complete pipeline: extraction -> cropping -> understanding analysis, supports input in .pdf, .jpg, .png and other formats\npython scripts/glm_ocr_pipeline.py \\\n  --file_path \"/data/report_page.jpg\" \\\n  --output_dir \"/data/output\""
      },
      {
        "title": "API Parameter Description",
        "body": "ParameterTypeRequiredDescriptionfile_pathstring✅Absolute path to input file (supports .pdf, .png, .jpg)output_dirstring✅Result output directory (used to save cropped images and JSON reports)"
      },
      {
        "title": "Return Result Structure (JSON)",
        "body": "The tool returns a list containing layout elements and their deep understanding:\n\n[\n  {\n    \"type\": \"table\",\n    \"bbox\": [100, 200, 500, 600],\n    \"content_info\": \"| Revenue | Q1 |\\n|---|---|\\n| 100M | ... |\",\n    \"deep_understanding\": \"(Generated by GLM-4.7) This table shows Q1 2024 revenue data. Combined with the 'market expansion strategy' mentioned in paragraph 3 of the body text, it can be seen that...\"\n  },\n  {\n    \"type\": \"image\",\n    \"bbox\": [100, 700, 500, 900],\n    \"content_info\": \"/data/output/images/report_page_img_2.png\",\n    \"deep_understanding\": \"(Generated by GLM-4.6V) This is a system architecture diagram. Visually, it shows the flow of clients connecting to servers through a Load Balancer. Combined with the title 'Fig 3' and context, this diagram is mainly used to illustrate...\"\n  }\n]"
      },
      {
        "title": "Environment Requirements",
        "body": "Environment variable ZHIPU_API_KEY must be configured\nPython 3.8+\nDependencies: zhipuai, pillow, beautifulsoup4"
      },
      {
        "title": "1. Model Routing Strategy",
        "body": "Table (表格): Content passed to GLM-4.7, combined with full text Markdown context for logical reasoning\nImage (图片): Image Base64 encoded and passed to GLM-4.6V, combined with OCR-extracted titles and full text context for multimodal understanding"
      },
      {
        "title": "2. Context Association",
        "body": "All understanding is based on the complete layout logic of the document (Markdown Context), not isolated fragment analysis."
      },
      {
        "title": "3. PDF Processing",
        "body": "Multi-page PDFs default to processing the first page. For batch processing, please extend the loop logic at the script level."
      }
    ],
    "body": "GLM-OCR Multimodal Deep Analysis\n\nThis tool builds a high-precision document parsing pipeline: using GLM-OCR for layout element extraction, calling GLM-4.7 for logical interpretation of table data, and calling GLM-4.6V for multimodal visual interpretation of images and charts.\n\nPipeline Implementation Architecture\n\nThis Skill consists of two core script stages, orchestrated through glm_ocr_pipeline.py:\n\n1. Extraction Stage (scripts/glm_ocr_extract.py)\nCore Model: GLM-OCR\nFunction: Responsible for physical layout analysis of documents\nOutput: Extract table HTML and clean to Markdown, automatically crop independent chart image files based on Bbox coordinates, and generate intermediate JSON containing full page reading order\n2. Understanding Stage (scripts/glm_understanding.py)\nCore Model: GLM-4.7 (text) / GLM-4.6V (visual)\nFunction: Responsible for deep semantic reasoning of content\nLogic:\nTables: Combine full text context, use GLM-4.7 to analyze business meaning of Markdown table data\nCharts: Combine full text context + cropped images, use GLM-4.6V for multimodal visual analysis\nInvocation Methods\nCommand Line Invocation\n# Run complete pipeline: extraction -> cropping -> understanding analysis, supports input in .pdf, .jpg, .png and other formats\npython scripts/glm_ocr_pipeline.py \\\n  --file_path \"/data/report_page.jpg\" \\\n  --output_dir \"/data/output\"\n\nAPI Parameter Description\nParameter\tType\tRequired\tDescription\nfile_path\tstring\t✅\tAbsolute path to input file (supports .pdf, .png, .jpg)\noutput_dir\tstring\t✅\tResult output directory (used to save cropped images and JSON reports)\nReturn Result Structure (JSON)\n\nThe tool returns a list containing layout elements and their deep understanding:\n\n[\n  {\n    \"type\": \"table\",\n    \"bbox\": [100, 200, 500, 600],\n    \"content_info\": \"| Revenue | Q1 |\\n|---|---|\\n| 100M | ... |\",\n    \"deep_understanding\": \"(Generated by GLM-4.7) This table shows Q1 2024 revenue data. Combined with the 'market expansion strategy' mentioned in paragraph 3 of the body text, it can be seen that...\"\n  },\n  {\n    \"type\": \"image\",\n    \"bbox\": [100, 700, 500, 900],\n    \"content_info\": \"/data/output/images/report_page_img_2.png\",\n    \"deep_understanding\": \"(Generated by GLM-4.6V) This is a system architecture diagram. Visually, it shows the flow of clients connecting to servers through a Load Balancer. Combined with the title 'Fig 3' and context, this diagram is mainly used to illustrate...\"\n  }\n]\n\nEnvironment Requirements\nEnvironment variable ZHIPU_API_KEY must be configured\nPython 3.8+\nDependencies: zhipuai, pillow, beautifulsoup4\nNotes\n1. Model Routing Strategy\nTable (表格): Content passed to GLM-4.7, combined with full text Markdown context for logical reasoning\nImage (图片): Image Base64 encoded and passed to GLM-4.6V, combined with OCR-extracted titles and full text context for multimodal understanding\n2. Context Association\n\nAll understanding is based on the complete layout logic of the document (Markdown Context), not isolated fragment analysis.\n\n3. PDF Processing\n\nMulti-page PDFs default to processing the first page. For batch processing, please extend the loop logic at the script level."
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/baokui/pdf-ocr-layout",
    "publisherUrl": "https://clawhub.ai/baokui/pdf-ocr-layout",
    "owner": "baokui",
    "version": "1.0.2",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/pdf-ocr-layout",
    "downloadUrl": "https://openagent3.xyz/downloads/pdf-ocr-layout",
    "agentUrl": "https://openagent3.xyz/skills/pdf-ocr-layout/agent",
    "manifestUrl": "https://openagent3.xyz/skills/pdf-ocr-layout/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/pdf-ocr-layout/agent.md"
  }
}