forked from EduCraft/curriculum-project-hub
ce18740870
Co-authored-by: Hong Jiarong <me@jrhim.com> Co-committed-by: Hong Jiarong <me@jrhim.com>
2.2 KiB
2.2 KiB
name, description
| name | description |
|---|---|
| pdf-to-md | Convert PDF documents to Markdown bundles using the convert_pdf_to_md tool. Handles PDFs from Feishu messages, local workspace files, and produces high-quality Markdown with LaTeX formulas and extracted images. |
PDF to Markdown Conversion
When to use
Use this skill when the user asks to convert a PDF to Markdown, extract text from a PDF, or turn a PDF document into an editable format.
How it works
The convert_pdf_to_md tool (provided by the cph_hub MCP server) calls
Alibaba Cloud Document Mind to parse the PDF. It:
- Extracts text in reading order (handles multi-column, scanned, and multi-language documents)
- Converts mathematical formulas to LaTeX (
$...$inline,$$...$$block) - Extracts tables as Markdown tables
- Downloads embedded images into the output directory
- Writes a single
document.mdfile plus image files
Workflow
PDF from a Feishu message
- Use
feishu_read_contextto find thefile_keyof the PDF attachment. - Use
feishu_download_resourceto download it into the workspace. - Use
convert_pdf_to_mdwith the downloaded file path and an output directory.
PDF already in the workspace
- Use
convert_pdf_to_mddirectly with the file path and an output directory.
Important rules
- Always use
convert_pdf_to_mdfor PDF→Markdown. Do NOT attempt to parse PDFs yourself with Read, Bash, Python, or any other method. The tool provides accurate formula, table, and image extraction that manual methods cannot match. - If
convert_pdf_to_mdfails because no capability connection is configured, tell the user to ask their organization admin to configure the Aliyun docmind credential in the admin web UI (组织后台 → 能力). - The output directory will be created if it does not exist.
- After conversion, use
send_fileto send the generated markdown back to the user if they requested it.
Output
The tool returns a list of generated files:
document.md— the main markdown file*.jpg/*.png— extracted images, referenced from the markdown
Cost
The conversion is billed per page (0.04 CNY/page ≈ $0.0056/page for the enhanced formula mode). The cost is automatically recorded on the run's usage ledger.