Markdown to PDF (CJK)
简介
Markdown to PDF (CJK)
原始描述
Convert Markdown files to professional PDF documents with full CJK (Chinese/Japanese/Korean) support. Uses reportlab for reliable rendering without external...
通过你的 Agent 添加
安装目录:md-to-pdf-cjk/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
技能正文
name: md-to-pdf-cjk
description: Convert Markdown files to professional PDF documents with full CJK (Chinese/Japanese/Korean) support. Uses reportlab for reliable rendering without external dependencies like wkhtmltopdf or LaTeX.
author: zacjiang
version: 1.0.0
tags: markdown, pdf, chinese, japanese, korean, CJK, convert, report, document
Markdown to PDF (CJK Support)
Convert Markdown to professional PDFs with full Chinese/Japanese/Korean text support.
Why This Exists
Most Markdown-to-PDF tools break on CJK characters, require LaTeX, or need heavy dependencies. This skill uses reportlab for lightweight, reliable PDF generation that works on any server — including 2GB RAM VPS instances.
Usage
python3 {baseDir}/scripts/md_to_pdf.py input.md "Document Title" output.pdf
Features
- ✅ Full CJK text rendering (Chinese, Japanese, Korean)
- ✅ Markdown headings, bold, italic, bullet lists, code blocks
- ✅ Tables with proper column alignment
- ✅ Automatic page breaks and numbering
- ✅ Lightweight — runs on minimal servers (2GB RAM)
- ✅ No LaTeX, no wkhtmltopdf, no Chrome/Puppeteer needed
Supported Markdown Elements
# H1 through #### H4 headings
**bold** and *italic*
- bullet lists (nested supported)
| table | rows | (pipe-delimited tables)
`inline code` and code blocks
--- horizontal rules
Dependencies
pip3 install reportlab
Font Configuration
python3 {baseDir}/scripts/md_to_pdf.py input.md "Document Title" output.pdf
- ✅ Full CJK text rendering (Chinese, Japanese, Korean)
- ✅ Markdown headings, bold, italic, bullet lists, code blocks
- ✅ Tables with proper column alignment
- ✅ Automatic page breaks and numbering
- ✅ Lightweight — runs on minimal servers (2GB RAM)
- ✅ No LaTeX, no wkhtmltopdf, no Chrome/Puppeteer needed
Supported Markdown Elements
# H1 through #### H4 headings
**bold** and *italic*
- bullet lists (nested supported)
| table | rows | (pipe-delimited tables)
`inline code` and code blocks
--- horizontal rules
Dependencies
pip3 install reportlab
Font Configuration
# H1 through #### H4 headings**bold** and *italic*- bullet lists (nested supported)| table | rows | (pipe-delimited tables)`inline code` and code blocks--- horizontal rulespip3 install reportlab
Font Configuration
The script auto-detects CJK fonts in common locations:
/usr/share/fonts/(Linux)/System/Library/Fonts/(macOS)
If no CJK font is found, it falls back to Helvetica (CJK characters will not render). Install a CJK font:
# RHEL/CentOS/Alibaba Cloud Linux
sudo yum install -y google-noto-sans-cjk-ttc-fonts
# Ubuntu/Debian
sudo apt install -y fonts-noto-cjk
Use Cases
- Generate PDF reports from AI analysis (audit reports, summaries)
- Convert documentation to distributable format
- Create invoices, proposals, or contracts in CJK languages
- Batch convert multiple Markdown files to PDF
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。