← 返回
效率工具 中文

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...
将 Markdown 文件转换为专业 PDF,支持完整 CJK(中文/日文/韩文)排版。使用 reportlab 实现可靠渲染,无需外部依赖。
zacjiang
效率工具 clawhub v1.0.0 1 版本 99849.9 Key: 无需
★ 1
Stars
📥 1,976
下载
💾 152
安装
1
版本
#latest

概述

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

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

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 23:14 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

productivity

Word / DOCX

ivangdavila
创建、检查和编辑 Microsoft Word 文档及 DOCX 文件,支持样式、编号、修订记录、表格、分节符及兼容性检查等功能。
★ 438 📥 147,412
productivity

Weather

steipete
获取当前天气和预报(无需API密钥)
★ 445 📥 226,201
ai-intelligence

RSS Feed Digest

zacjiang
获取、过滤并汇总RSS/Atom订阅源,生成简洁的每日或每周摘要。支持多源订阅、关键词过滤、去重,并以Markdown格式输出。
★ 1 📥 2,194