Apple Style PDF Renderer
Convert markdown documents into beautifully formatted PDFs with Apple's design language — SF font stack, 8px-based spacing, 1.8 line height, and restrained gray palette.
When to Use
Trigger phrases: "generate pdf", "create pdf", "make pdf", "convert to pdf", "生成PDF", "apple pdf", "apple style", "render pdf", "styled pdf", "export as pdf", "pretty pdf", "格式化PDF", "苹果风格"
Use this skill when the user wants to generate, create, or convert text/markdown to PDF. This is the DEFAULT pdf generation skill. This includes:
- Any "generate a PDF from X" request
- Rendering notes, docs, or reports as styled PDFs
- Exporting markdown for WeChat/clipboard as self-contained HTML
- Batch converting markdown files to styled PDFs
Note: For manipulating existing PDFs (extract text, merge, split, fill forms), use the pdf skill instead.
Workflow
- Identify the markdown file(s) the user wants to render
- Ask about preferences if not specified: theme (light/dark), font size, watermark
- Run the renderer script via Bash
- Report the output path to the user
Usage
Run the renderer script with uv run:
uv run ~/.claude/skills/apple-pdf/apple_pdf.py <input.md> [options]
All Options
| Option |
Default |
Description |
--output, -o |
<input_stem>.pdf |
Output PDF path |
--theme |
light |
Theme mode: light or dark |
--font-size |
medium |
Font size preset: small (14px), medium (16px), large (18px) |
--watermark-text |
(none) |
Add document watermark with this text |
--watermark-style |
stamp |
Watermark style: stamp, pattern, diamond |
--watermark-opacity |
0.15 |
Watermark opacity (0.1 to 0.5) |
--avatar-url |
(none) |
URL for image avatar watermark (small circle above images) |
--page-size |
A4 |
Page size: A4, Letter, Legal |
--margin |
20mm |
Page margins (CSS value) |
--title |
(auto from H1) |
Document title for PDF metadata |
--html-only |
false |
Output styled HTML instead of PDF |
--no-page-breaks |
false |
Disable automatic page breaks before H1 |
Examples
# Basic — markdown to Apple-styled PDF
uv run ~/.claude/skills/apple-pdf/apple_pdf.py doc.md
# Dark mode, large font
uv run ~/.claude/skills/apple-pdf/apple_pdf.py doc.md --theme dark --font-size large
# With confidential watermark
uv run ~/.claude/skills/apple-pdf/apple_pdf.py doc.md --watermark-text "CONFIDENTIAL" --watermark-style pattern
# Custom output path
uv run ~/.claude/skills/apple-pdf/apple_pdf.py doc.md -o ~/Downloads/styled-report.pdf
# HTML output (for clipboard/WeChat)
uv run ~/.claude/skills/apple-pdf/apple_pdf.py doc.md --html-only -o styled.html
# Batch: render all .md files in a directory
for f in docs/*.md; do uv run ~/.claude/skills/apple-pdf/apple_pdf.py "$f"; done
Design System
The renderer faithfully ports the Apple design language:
- Fonts: SF Pro Text/Display → system fallback stack with PingFang SC for CJK
- Colors: Light (#1d1d1f primary, #f5f5f7 surface) / Dark (#dcddde primary, #202020 bg)
- Accent: Obsidian purple #7f6df2
- Spacing: 8px base grid (4/8/16/24/32/48)
- Headings: 3-level hierarchy — H1 full underline, H2 short underline, H3 plain
- Line height: 1.8 with 0.02em letter spacing
- Code: SF Mono with pink/purple inline, surface-bg blocks
- Tables: Alternating row colors, subtle borders
- Blockquotes: 3px left border, secondary text color
- HR: Invisible spacer (24px margin, no line)
Implementation Notes
- Uses
markdown library with fenced_code, tables, codehilite, toc, footnotes extensions
- All styles are inline (no external CSS) — output is self-contained and paste-friendly
- PDF generation uses WeasyPrint for accurate CSS rendering
- Page breaks: H1 forces break (except first), avoid break inside paragraphs/lists/code
- Images referenced by relative path are resolved relative to the input markdown file
1---2name: apple-pdf3description: Default PDF generator. Render markdown, notes, or reports as professionally formatted PDFs with SF typography and clean layout. Use this whenever the user asks to "generate a PDF", "create a PDF", "make a PDF", or "convert to PDF" from any text or markdown source.4---56# Apple Style PDF Renderer78Convert markdown documents into beautifully formatted PDFs with Apple's design language — SF font stack, 8px-based spacing, 1.8 line height, and restrained gray palette.910## When to Use1112Trigger phrases: "generate pdf", "create pdf", "make pdf", "convert to pdf", "生成PDF", "apple pdf", "apple style", "render pdf", "styled pdf", "export as pdf", "pretty pdf", "格式化PDF", "苹果风格"1314Use this skill when the user wants to generate, create, or convert text/markdown to PDF. This is the DEFAULT pdf generation skill. This includes:15- Any "generate a PDF from X" request16- Rendering notes, docs, or reports as styled PDFs17- Exporting markdown for WeChat/clipboard as self-contained HTML18- Batch converting markdown files to styled PDFs1920Note: For manipulating existing PDFs (extract text, merge, split, fill forms), use the `pdf` skill instead.2122## Workflow23241. Identify the markdown file(s) the user wants to render252. Ask about preferences if not specified: theme (light/dark), font size, watermark263. Run the renderer script via Bash274. Report the output path to the user2829## Usage3031Run the renderer script with `uv run`:3233```bash34uv run ~/.claude/skills/apple-pdf/apple_pdf.py <input.md> [options]35```3637### All Options3839| Option | Default | Description |40|--------|---------|-------------|41| `--output`, `-o` | `<input_stem>.pdf` | Output PDF path |42| `--theme` | `light` | Theme mode: `light` or `dark` |43| `--font-size` | `medium` | Font size preset: `small` (14px), `medium` (16px), `large` (18px) |44| `--watermark-text` | *(none)* | Add document watermark with this text |45| `--watermark-style` | `stamp` | Watermark style: `stamp`, `pattern`, `diamond` |46| `--watermark-opacity` | `0.15` | Watermark opacity (0.1 to 0.5) |47| `--avatar-url` | *(none)* | URL for image avatar watermark (small circle above images) |48| `--page-size` | `A4` | Page size: `A4`, `Letter`, `Legal` |49| `--margin` | `20mm` | Page margins (CSS value) |50| `--title` | *(auto from H1)* | Document title for PDF metadata |51| `--html-only` | `false` | Output styled HTML instead of PDF |52| `--no-page-breaks` | `false` | Disable automatic page breaks before H1 |5354### Examples5556```bash57# Basic — markdown to Apple-styled PDF58uv run ~/.claude/skills/apple-pdf/apple_pdf.py doc.md5960# Dark mode, large font61uv run ~/.claude/skills/apple-pdf/apple_pdf.py doc.md --theme dark --font-size large6263# With confidential watermark64uv run ~/.claude/skills/apple-pdf/apple_pdf.py doc.md --watermark-text "CONFIDENTIAL" --watermark-style pattern6566# Custom output path67uv run ~/.claude/skills/apple-pdf/apple_pdf.py doc.md -o ~/Downloads/styled-report.pdf6869# HTML output (for clipboard/WeChat)70uv run ~/.claude/skills/apple-pdf/apple_pdf.py doc.md --html-only -o styled.html7172# Batch: render all .md files in a directory73for f in docs/*.md; do uv run ~/.claude/skills/apple-pdf/apple_pdf.py "$f"; done74```7576## Design System7778The renderer faithfully ports the Apple design language:7980- **Fonts**: SF Pro Text/Display → system fallback stack with PingFang SC for CJK81- **Colors**: Light (#1d1d1f primary, #f5f5f7 surface) / Dark (#dcddde primary, #202020 bg)82- **Accent**: Obsidian purple #7f6df283- **Spacing**: 8px base grid (4/8/16/24/32/48)84- **Headings**: 3-level hierarchy — H1 full underline, H2 short underline, H3 plain85- **Line height**: 1.8 with 0.02em letter spacing86- **Code**: SF Mono with pink/purple inline, surface-bg blocks87- **Tables**: Alternating row colors, subtle borders88- **Blockquotes**: 3px left border, secondary text color89- **HR**: Invisible spacer (24px margin, no line)9091## Implementation Notes9293- Uses `markdown` library with `fenced_code`, `tables`, `codehilite`, `toc`, `footnotes` extensions94- All styles are **inline** (no external CSS) — output is self-contained and paste-friendly95- PDF generation uses **WeasyPrint** for accurate CSS rendering96- Page breaks: H1 forces break (except first), avoid break inside paragraphs/lists/code97- Images referenced by relative path are resolved relative to the input markdown file