# Send Markdown to PDF Converter (v2.0) to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "md2pdf-converter",
    "name": "Markdown to PDF Converter (v2.0)",
    "source": "tencent",
    "type": "skill",
    "category": "内容创作",
    "sourceUrl": "https://clawhub.ai/tianxingleo/md2pdf-converter",
    "canonicalUrl": "https://clawhub.ai/tianxingleo/md2pdf-converter",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/md2pdf-converter",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=md2pdf-converter",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "scripts/generate_emoji_mapping.py",
      "scripts/md2pdf-local.sh"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/md2pdf-converter"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/md2pdf-converter",
    "downloadUrl": "https://openagent3.xyz/downloads/md2pdf-converter",
    "agentUrl": "https://openagent3.xyz/skills/md2pdf-converter/agent",
    "manifestUrl": "https://openagent3.xyz/skills/md2pdf-converter/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/md2pdf-converter/agent.md"
  }
}
```
## Documentation

### Overview

Convert 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.

### Quick Start

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

### Features

✅ Full Unicode support (Chinese, Japanese, Korean)
✅ Complete emoji support (Twemoji 14.0.0, 3660 colorful PNGs)
✅ All emoji variants (skin tones, hair styles, regional flags, etc.)
✅ Offline operation after initial setup
✅ Professional PDF layout with page numbers
✅ Code highlighting, tables, blockquotes
✅ Accurate emoji mapping via Python pre-generated lookup table

### Dependencies

Pandoc - Universal document converter
WeasyPrint - CSS-to-PDF renderer
Python 3 - For emoji mapping generation
wget - For emoji download (first run only)

### How It Works

First run: Downloads Twemoji 14.0.0 to ~/.cache/md2pdf/emojis/
Python script: Generates emoji → filename mapping table (emoji_mapping.json)
Pandoc: Converts Markdown to HTML with a Lua filter that replaces emoji characters with local image references
WeasyPrint: Renders HTML to PDF using:

AR PL UMing CN for Chinese characters
Local emoji images (PNG, 72x72px, colorful)
Professional CSS styling

### Emoji Cache Location

~/.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",
      ...
    }

### Emoji Mapping

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.

### Fonts

Primary Chinese font: AR PL UMing CN

Fallback: Noto Sans SC, Noto Sans CJK SC, Microsoft YaHei

Monospace: Menlo, Monaco

### v2.0 (Current)

✅ Switched to Twemoji 14.0.0 (complete version)
✅ 3660 colorful emojis (including all variants)
✅ Python pre-generated mapping for accurate emoji replacement
✅ Fixed black-and-white emoji display issue
✅ Proper support for emoji variants (skin tones, hair styles, etc.)

### v1.0 (Previous)

Used emoji-datasource-google (~2000-3000 emojis)
Simple hex-based filename matching (inaccurate for variants)
Some emojis displayed as Unicode characters (black-and-white)

### Font Issues

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"

### Emoji Not Showing

Check if emoji cache exists: ls ~/.cache/md2pdf/emojis/
Check if mapping exists: ls ~/.cache/md2pdf/emoji_mapping.json
If missing, delete cache and re-run: rm -rf ~/.cache/md2pdf
Verify emoji file exists: ls ~/.cache/md2pdf/emojis/1f600.png

### Emoji Displaying as Black-and-White

This issue has been FIXED in v2.0. If you still see black-and-white emojis:

Verify you're using the v2.0 script:
grep "TWEMOJI_VERSION" scripts/md2pdf-local.sh
# Should show: TWEMOJI_VERSION="14.0.0"



Clear cache and regenerate:
rm -rf ~/.cache/md2pdf
bash scripts/md2pdf-local.sh test.md test.pdf

### WeasyPrint Errors

Install missing dependencies:

# Ubuntu/Debian
sudo apt-get install python3-weasyprint

# Or via pip
pip3 install weasyprint

### Python Script Errors

If generate_emoji_mapping.py fails:

# Check Python version
python3 --version
# Should be Python 3.6+

# Check emoji cache
ls ~/.cache/md2pdf/emojis

### scripts/

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:

Automatic Twemoji download and caching
Python pre-generated emoji mapping (accurate)
Lua filter for emoji replacement
CSS styling for professional output
Temporary file cleanup (automatic)

### Comparison: v1.0 vs v2.0

Featurev1.0 (Old)v2.0 (New)Emoji Sourceemoji-datasource-googleTwemoji 14.0.0Emoji Count~2000-30003660Color Display❌ Unstable✅ StableVariants Support❌ Incomplete✅ CompleteMapping Accuracy⚠️ Low✅ HighOffline Support✅ After first run✅ After first runFirst Run Size~68MB~150MB

### Performance

First run: ~150MB download, 10-30 seconds (depending on network)
Subsequent runs: Offline, seconds-level conversion
Memory usage: ~150MB for emoji cache
PDF generation: 1-5 seconds per page

### Limitations

Missing emojis (newer than Twemoji 14.0.0) will display as Unicode characters
First run requires internet connection (for Twemoji download)
Emoji cache size: ~150MB (3660 PNG files at 72x72px)
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: tianxingleo
- Version: 2.0.0
## Source health
- Status: healthy
- Source download looks usable.
- Yavira can redirect you to the upstream package for this source.
- Health scope: source
- Reason: direct_download_ok
- Checked at: 2026-04-23T16:43:11.935Z
- Expires at: 2026-04-30T16:43:11.935Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/md2pdf-converter)
- [Send to Agent page](https://openagent3.xyz/skills/md2pdf-converter/agent)
- [JSON manifest](https://openagent3.xyz/skills/md2pdf-converter/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/md2pdf-converter/agent.md)
- [Download page](https://openagent3.xyz/downloads/md2pdf-converter)