md2pdf-converterOffline Markdown to PDF converter with full Unicode support using Pandoc + WeasyPrint + local emoji cache. Converts Markdown documents to professional PDFs w...
Install via ClawdBot CLI:
clawdbot install tianxingleo/md2pdf-converterConvert Markdown documents to professional PDFs with FULL Unicode support, Chinese fonts, and colorful emojis (3660 emojis including all variants). Uses Pandoc + WeasyPrint with a local Twemoji cache to work offline after first run.
Convert a Markdown file to PDF:
bash scripts/md2pdf-local.sh input.md output.pdf
First run only: Downloads ~150MB emoji resources (Twemoji 14.0.0) from GitHub. Subsequent runs work offline.
Example:
bash scripts/md2pdf-local.sh report.md report.pdf
~/.cache/md2pdf/emojis/emoji_mapping.json)~/.cache/md2pdf/
├── emojis/ # 3660 colorful PNG files
│ ├── 0023-fe0f-20e3.png
│ ├── 1f600.png
│ └── ...
└── emoji_mapping.json # Emoji to filename mapping
{
"🙀": "1f600.png",
"⌛": "0023-fe0f-20e3.png",
...
}
The Python script generate_emoji_mapping.py scans all Twemoji files and creates a precise mapping from emoji characters to PNG filenames. This ensures accurate emoji replacement even for complex variants like skin tones and regional indicators.
Primary Chinese font: AR PL UMing CN
Fallback: Noto Sans SC, Noto Sans CJK SC, Microsoft YaHei
Monospace: Menlo, Monaco
If Chinese characters display incorrectly, ensure AR PL UMing CN is installed:
# Ubuntu/Debian
sudo apt-get install fonts-arphic-uming
# Check if installed
fc-list | grep "AR PL UMing"
ls ~/.cache/md2pdf/emojis/ls ~/.cache/md2pdf/emoji_mapping.jsonrm -rf ~/.cache/md2pdfls ~/.cache/md2pdf/emojis/1f600.pngThis issue has been FIXED in v2.0. If you still see black-and-white emojis:
grep "TWEMOJI_VERSION" scripts/md2pdf-local.sh
# Should show: TWEMOJI_VERSION="14.0.0"
rm -rf ~/.cache/md2pdf
bash scripts/md2pdf-local.sh test.md test.pdf
Install missing dependencies:
# Ubuntu/Debian
sudo apt-get install python3-weasyprint
# Or via pip
pip3 install weasyprint
If generate_emoji_mapping.py fails:
# Check Python version
python3 --version
# Should be Python 3.6+
# Check emoji cache
ls ~/.cache/md2pdf/emojis
md2pdf-local.sh - Main conversion script with automatic emoji caching and mapping
generate_emoji_mapping.py - Python script to generate emoji lookup table
Usage: Direct execution from any location (uses absolute paths):
bash /path/to/skills/md2pdf-converter/scripts/md2pdf-local.sh input.md output.pdf
Key Features:
| Feature | v1.0 (Old) | v2.0 (New) |
|---------|----------------|---------------|
| Emoji Source | emoji-datasource-google | Twemoji 14.0.0 |
| Emoji Count | ~2000-3000 | 3660 |
| Color Display | ❌ Unstable | ✅ Stable |
| Variants Support | ❌ Incomplete | ✅ Complete |
| Mapping Accuracy | ⚠️ Low | ✅ High |
| Offline Support | ✅ After first run | ✅ After first run |
| First Run Size | ~68MB | ~150MB |
AI Usage Analysis
Analysis is being generated… refresh in a few seconds.
Edit PDFs with natural-language instructions using the nano-pdf CLI.
Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.
Convert documents and files to Markdown using markitdown. Use when converting PDF, Word (.docx), PowerPoint (.pptx), Excel (.xlsx, .xls), HTML, CSV, JSON, XML, images (with EXIF/OCR), audio (with transcription), ZIP archives, YouTube URLs, or EPubs to Markdown format for LLM processing or text analysis.
用 MinerU API 解析 PDF/Word/PPT/图片为 Markdown,支持公式、表格、OCR。适用于论文解析、文档提取。
Generate hand-drawn style diagrams, flowcharts, and architecture diagrams as PNG images from Excalidraw JSON
The awesome PPT format generation tool provided by baidu.