svg-pptx-gen
SVG 转 PPTX 生成器
Generate professional presentation slides (.pptx) by creating SVG visuals with AI and packaging them into PowerPoint files. Use when the user wants to create presentations, slide decks, PPT, or PPTX files with AI-generated visuals. Triggers on requests like "make a presentation", "create slides", "生成PPT", "制作幻灯片", or when producing .pptx output with visual SVG content.
SVG-PPTX Generator
Generate professional presentations by creating SVG slide visuals and packaging them into .pptx files.
Core Workflow
User Input (topic/outline) → Parse into per-slide content → Generate SVG per slide → Package into .pptx
Step 1: Parse User Input into Slide Outlines
If the user provides:
- A topic: Decompose into 4-8 slides covering introduction, key points, and conclusion
- An outline: Use each section as a slide
- Bullet points: Group into logical slides (1 main idea per slide)
- A document/article: Extract key sections as slide content
For each slide, produce a concise Chinese content summary (50-100 chars) that captures the core message.
Step 2: Select Style
Default to Style 01 unless user specifies otherwise. See reference.md for all 10 style presets.
Quick reference:
| ID | Name | Best For |
|---|---|---|
| 01 | Standard Visual | General purpose, balanced layout |
| 02 | Structured Detail | Content-heavy, hierarchical info |
| 03 | Clean Aesthetic | Minimalist, elegant presentations |
| 04 | Data & Charts | Numbers, statistics, comparisons |
| 05 | Text & Image | Mixed media, illustrated content |
| 06 | Timeline Flow | Chronological, process sequences |
| 07 | Grid Layout | Categorized, modular content |
| 08 | Comparison | Side-by-side contrasts |
| 09 | Highlight Focus | Key metrics, important takeaways |
| 10 | Process Steps | Step-by-step workflows |
Step 3: Generate SVG for Each Slide
For each slide, generate an SVG following these mandatory rules:
SVG Specification:
- ViewBox:
0 0 960 540(16:9 aspect ratio) - Background: white (
#FFFFFF) - Font: Use system sans-serif fonts (
font-family="system-ui, -apple-system, sans-serif") - All text must use
<text>elements (NOT<foreignObject>) - No external images or resources
- Embed all styles inline (no
<style>blocks with classes)
Prompt Construction (replicate original app logic):
Build the prompt as: GLOBAL_PROMPT_PREFIX + STYLE_PROMPT + SLIDE_CONTENT
Where:
GLOBAL_PROMPT_PREFIX="请你生成SVG代码,要求尺寸:16:9,内容附后面n"STYLE_PROMPT= the prompt text from the selected style preset (see reference.md)SLIDE_CONTENT= the concise content summary for this slide
Quality Skills (apply 3-5 randomly per slide): Pick from: 版式规划, 层级梳理, 标题统一, 文案压缩, 留白校准, 字号优化, 色彩平衡, 边界防溢出, 箭头克制, 重叠排查
Incorporate these skill directives into your SVG generation process mentally — ensure the output adheres to the selected skills.
Critical SVG Quality Rules:
- Title bar at top: consistent design across all slides in the deck
- Text must not overlap — verify x/y coordinates leave sufficient spacing
- Font sizes: titles ≥ 28px, body ≥ 16px, annotations ≥ 12px
- Use rounded rectangles, subtle shadows, and soft gradients for modern aesthetics
- Color palette: pick 2-3 accent colors and use them consistently across the deck
- Adequate whitespace: margins ≥ 40px from edges, ≥ 20px between elements
- Charts/diagrams use simple geometric shapes (rect, circle, line, polygon)
- Chinese text: ensure sufficient character spacing and line height (1.5x font size minimum)
Step 4: Package into .pptx
After generating all SVGs, use the pptx skill to create the final .pptx file:
- Save each SVG to a temporary
.svgfile - Invoke the
pptxskill to create a presentation with one slide per SVG - Each slide should embed the SVG as a full-bleed image covering the entire slide area
- Set slide dimensions to 13.33" × 7.5" (standard 16:9 widescreen)
- Deliver the final .pptx file to the user
Fallback: If the pptx skill is unavailable, save SVGs individually and instruct the user to import them into PowerPoint manually.
Refinement Workflow
After initial generation, the user may request changes:
- Style change: Regenerate the specific slide(s) with a different style preset
- Content edit: Modify the slide content and regenerate the SVG
- Visual tweak: Adjust specific visual aspects (colors, layout, fonts) and regenerate
For refinement, include the existing SVG code in context and provide targeted modifications.
Multi-language Support
- If user writes in Chinese → generate content in Chinese
- If user writes in English → generate content in English (but keep the GLOBAL_PROMPT_PREFIX in Chinese as it guides SVG structure)
- Mixed content: follow the dominant language of user input
Output Checklist
Before delivering, verify:
- [ ] All SVGs have correct viewBox
0 0 960 540 - [ ] No text overlaps in any slide
- [ ] Consistent title bar design across slides
- [ ] Color palette is coherent across the deck
- [ ] .pptx file is generated and saved successfully