← Back to Skills Marketplace
69
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install chrome-markdown2pdf
Description
使用 Chrome headless 将 Markdown 文件转为排版精美的 PDF,支持表格、代码块、中文。 Activate when user mentions: md转pdf、markdown转pdf、转PDF、导出PDF、生成PDF、chrome转pdf。
README (SKILL.md)
Markdown 转 PDF 工具
将 Markdown 文件转为带样式的 PDF,排版支持标题、表格、代码块、引用等。
使用方法
python3 ~/.openclaw/workspace/skills/chrome-markdown2pdf/scripts/md2pdf.py \
--input "/path/to/file.md" \
--output "/path/to/output.pdf"
如果不指定 --output,默认输出到输入文件同目录,后缀改为 .pdf。
参数
| 参数 | 必填 | 说明 |
|---|---|---|
--input / -i |
✅ | 输入 Markdown 文件路径 |
--output / -o |
否 | 输出 PDF 路径(默认同目录替换后缀) |
依赖
- Google Chrome(headless 模式渲染 PDF)
检查是否安装:
google-chrome --version
转换流程
- Markdown → HTML(内置转换器,支持表格、代码块、标题、加粗、斜体、行内代码、引用)
- HTML → PDF(Chrome headless
--print-to-pdf)
PDF 样式
- 中文字体:Microsoft YaHei / PingFang SC
- 表格带边框和斑马纹
- 代码块灰色背景
- 标题彩色层级(H1黑色/H2蓝色/H3绿色/H4紫色)
示例
# 基本用法
python3 ~/.openclaw/workspace/skills/chrome-markdown2pdf/scripts/md2pdf.py \
-i /home/robot-01/work/report.md
# 指定输出路径
python3 ~/.openclaw/workspace/skills/chrome-markdown2pdf/scripts/md2pdf.py \
-i /home/robot-01/work/report.md \
-o /tmp/output.pdf
Usage Guidance
This skill appears to honestly implement Markdown→PDF conversion using a local Chrome headless process and does not ask for credentials. Before installing, ensure you have a trusted Chrome/Chromium binary available (the script calls 'google-chrome'); the registry metadata should ideally list that binary as a requirement. Review and run the included script in a safe environment if you have concerns, and remember the script will read the Markdown file you point it to and write the resulting PDF to the specified location.
Capability Analysis
Type: OpenClaw Skill
Name: chrome-markdown2pdf
Version: 1.0.0
The script `scripts/md2pdf.py` is vulnerable to HTML injection because it fails to sanitize Markdown input before rendering it via headless Chrome. Specifically, the `md_to_html` and `inline_format` functions do not escape HTML entities, allowing raw HTML tags or scripts in a Markdown file to be executed by the Chrome renderer. This could be exploited to perform local file disclosure or SSRF if the agent processes untrusted Markdown content. While the behavior aligns with the stated purpose and lacks evidence of intentional malice, the lack of input sanitization is a significant security flaw.
Capability Assessment
Purpose & Capability
The name/description and included script both implement Markdown→HTML→PDF via Chrome headless, which matches the stated purpose. Minor incoherence: registry metadata lists no required binaries, but SKILL.md and the script require a local 'google-chrome' binary (Chrome headless) to render PDF.
Instruction Scope
SKILL.md instructs running the provided Python script on local files in the workspace; the script only reads the specified Markdown file, writes a temporary HTML file and the output PDF, and invokes Chrome to print the PDF. It does not access environment variables, network endpoints, or other system configuration beyond invoking 'google-chrome' and deleting the temp file.
Install Mechanism
There is no install spec (instruction-only plus a local script). No external downloads or archives; the only runtime dependency is a system Chrome/Chromium binary. This is low-risk from an install perspective.
Credentials
The skill requests no environment variables, credentials, or config paths. The script operates on user-specified input/output file paths and does not attempt to read secrets or unrelated config.
Persistence & Privilege
always is false and the skill does not request persistent/system-wide changes. It does not modify other skills or global agent settings.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install chrome-markdown2pdf - After installation, invoke the skill by name or use
/chrome-markdown2pdf - Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
chrome-markdown2pdf 1.0.0
- 首次发布:将 Markdown 文件通过 Chrome headless 渲染为排版美观的 PDF,全面支持表格、代码块、中文和多样样式。
- 支持命令行参数指定输入(必填)和输出路径。
- 自动转换 Markdown 为带样式的 PDF,输出包含优化的中文字体和自定义样式(如表格斑马纹、代码块灰底、彩色标题)。
- 要求已安装 Google Chrome,可使用 `google-chrome --version` 检查安装情况。
- 提供命令行使用示例和参数说明,便于上手。
Metadata
Frequently Asked Questions
What is Chrome Markdown to PDF?
使用 Chrome headless 将 Markdown 文件转为排版精美的 PDF,支持表格、代码块、中文。 Activate when user mentions: md转pdf、markdown转pdf、转PDF、导出PDF、生成PDF、chrome转pdf。 It is an AI Agent Skill for Claude Code / OpenClaw, with 69 downloads so far.
How do I install Chrome Markdown to PDF?
Run "/install chrome-markdown2pdf" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Chrome Markdown to PDF free?
Yes, Chrome Markdown to PDF is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Chrome Markdown to PDF support?
Chrome Markdown to PDF is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Chrome Markdown to PDF?
It is built and maintained by Earl-chen (@earl-chen); the current version is v1.0.0.
More Skills