π¦ ClawHub
Markdown to PDF (CJK)
by @zacjiang
Convert Markdown files to professional PDF documents with full CJK (Chinese/Japanese/Korean) support. Uses reportlab for reliable rendering without external...
TERMINAL
clawhub install md-to-pdf-cjkπ About This Skill
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
Supported Markdown Elements
# H1 through #### H4 headingsbold and *italic*- bullet lists (nested supported)| table | rows | (pipe-delimited tables) inline code and ` code blocks - --- horizontal rules
Dependencies
bash pip3 install reportlab
bash/usr/share/fonts/Font Configuration
The script auto-detects CJK fonts in common locations:
(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-fontsUbuntu/Debian
sudo apt install -y fonts-noto-cjk ``Use Cases
β‘ When to Use
π‘ Examples
python3 {baseDir}/scripts/md_to_pdf.py input.md "Document Title" output.pdf