with one click
extract-content-with-image
将本地 PDF、TXT、Word、PPT 文件分割为文本和图片chunk。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
将本地 PDF、TXT、Word、PPT 文件分割为文本和图片chunk。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Operate LinkMind Interaction menu features against the hosted LinkMind server with API-key identity: recommended/joined/owned channels, subscribe/unsubscribe, monitor/list/send messages, create/enable/disable/delete/translate channels. Use when the user asks to manage LinkMind interaction/social channels without installing the LinkMind client.
Operate social channels through LinkMind HTTP APIs: view the latest messages by channel name, browse new messages, or send text/questions/announcements to a specified channel. Use this when the user naturally asks to read or write messages in a channel.
Build apps with the Claude API or Anthropic SDK. TRIGGER when: code imports `anthropic`/`@anthropic-ai/sdk`/`claude_agent_sdk`, or user asks to use Claude API, Anthropic SDKs, or Agent SDK. DO NOT TRIGGER when: code imports `openai`/other AI SDK, general programming, or ML/data-science tasks.
| name | extract_content_with_image |
| description | 将本地 PDF、TXT、Word、PPT 文件分割为文本和图片chunk。 |
| version | 1.0.0 |
| author | lagi |
| tags | ["extract","pdf","chunks","images"] |
执行脚本前请先激活环境
scripts/extract_content_with_image.pyargv[1] 为待处理文件的本地绝对路径.pdf、.txt、.doc、.docx、.ppt、.pptxjson.loads / parseJsonObject{"status":"success","filepath":"...pdf","data":[...]}{"status":"failed","msg":"<具体异常信息>"}data 中每个元素形如:{"text":"...", "image":"<图片列表的 JSON 字符串或空串>"}PyMuPDF(fitz)和 Pillowsoffice,用于 .doc/.docx/.ppt/.pptx/.txt 转 PDF;可用环境变量 SOFFICE_PATH 指定soffice 时:
.txt 会直接用 fitz 生成 PDF,并基于原始文本做分块.doc/.docx/.ppt/.pptx 会返回失败 JSONtransformers + TOKENIZER_DIR 或 MODEL_DIR
CHUNK_SIZE=512SKILL_OUTPUT_DIR/extract_content_with_image/<run_id>/files/filepath 返回转换后的 PDF 路径image 字段中以绝对路径返回page_dir 会在结束时清理,保留裁剪后的图片文件