Generate pdf

From stevehuang0115/crewly · View interactive version

Generate pdf is an AI agent skill from the GitHub repository stevehuang0115/crewly. Convert a Markdown (or HTML) file to a styled PDF with full CJK (Chinese/Japanese/Korean) font support. Thin wrapper over the pdf-tools skill — headless Chrome preferred, WeasyPrint fallback. For multi-part documents, merging or reading PDFs use pdf-tools directly.

How to use this skill

Skill file

Generate PDF

Convert a Markdown (or HTML) file to a professionally styled PDF with full CJK

(Chinese/Japanese/Korean) font support.

This skill is kept for compatibility; it calls pdf-tools

({{AGENT_SKILLS_PATH}}/pdf-tools/execute.sh), which also merges several parts

into one PDF and reads PDFs. Prefer pdf-tools for anything beyond one file.

Pipeline

  1. Markdown → HTML with a clean A4 stylesheet (CJK font stacks: PingFang /

Hiragino on macOS, Noto CJK on Linux). HTML input is printed as-is.

  1. HTML → PDF with headless Chrome/Chromium when installed, else WeasyPrint.

Chrome renders CJK correctly whenever CJK fonts are installed (macOS has them;

on Linux the pdf-tools setup installs fonts-noto-cjk).

Parameters

| Parameter | Required | Description |

|-----------|----------|-------------|

| input | Yes | Path to the input Markdown (or HTML) file |

| output | No | Path for the output PDF (defaults to the input path with .pdf) |

| title | No | Document title |

| css | No | Extra stylesheet appended to the default one |

| engine | No | auto (default), chrome, weasyprint |

Example

bash {{AGENT_SKILLS_PATH}}/core/generate-pdf/execute.sh '{"input":"/tmp/report.md","output":"/tmp/report.pdf","title":"My Report"}'

Output

{"success": true, "pdf": "/tmp/report.pdf", "size": 364024, "engine": "chrome"}

If a dependency is missing the result carries "needsSetup": true, "skill": "pdf-tools":

tell the user you are setting up the PDF tools and run install-skill --id pdf-tools.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.