home / skills / aidotnet / moyucode / pdf-generator
This skill generates PDFs from HTML, Markdown, or text with customizable templates, styles, and page configurations to meet formatting needs.
npx playbooks add skill aidotnet/moyucode --skill pdf-generatorReview the files below or copy the command above to add this skill to your agents.
---
name: pdf-generator
description: 从HTML、Markdown或文本内容生成PDF文档,支持模板、样式和页面配置。
metadata:
short-description: 从HTML/Markdown生成PDF
source:
repository: https://github.com/foliojs/pdfkit
license: MIT
---
# PDF Generator Tool
## Description
Generate PDF documents from HTML, Markdown, or text with customizable styling and layout.
## Trigger
- `/generate-pdf` command
- User requests PDF generation
- User needs to export document as PDF
## Usage
```bash
# Generate PDF from Markdown
python scripts/generate_pdf.py --input "document.md" --output "document.pdf"
# Generate PDF from HTML
python scripts/generate_pdf.py --input "report.html" --output "report.pdf" --format html
# Generate PDF with custom options
python scripts/generate_pdf.py --input "doc.md" --output "doc.pdf" --title "My Report" --author "John" --page-size A4
```
## Tags
`pdf`, `document`, `export`, `markdown`, `html`
## Compatibility
- Codex: ✅
- Claude Code: ✅
This skill generates high-quality PDF documents from HTML, Markdown, or plain text with support for templates, custom styles, and page configuration. It streamlines export workflows by converting content into printable, shareable PDFs while preserving layout and typography. The tool exposes command triggers and options to control metadata, page size, and format.
The generator accepts input as Markdown, HTML, or text, applies a chosen template and stylesheet, then renders the result to PDF. Command-line options let you set document metadata (title, author), page parameters (size, margins), and format hints. Under the hood it converts source to an HTML rendering and uses a headless renderer to produce a pixel-perfect PDF.
What input formats are supported?
You can provide Markdown, HTML, or plain text as source input; Markdown is converted to HTML before rendering.
How do I control page size and margins?
Set command-line options for page size (e.g., A4, Letter) and margins. Templates can include CSS @page rules for finer control.