SuperAPI AI Directory

html-to-pptx

Frontend & websites

View repository

Updated 10-16 02:31

About this skill

html-to-pptx — Convert HTML presentations to PPTX

Convert HTML presentations generated by html-ppt to .pptx files in one click.

Agent Usage Guide

When the user says "export PPTX", "convert to PPT", "HTML to PPTX", or similar:

  1. Confirm the HTML file path — usually in ~/.claude/skills/html-ppt/examples/<deck-name>/index.html, or a path specified by the user
  2. Run the conversion command:
    bash ~/.claude/skills/html-to-pptx/scripts/html-to-pptx.sh <html文件路径>
    
  3. Report the result — tell the user the path and size of the PPTX file
  4. Optional parameters:
    • --ratio 4:3 — specify the aspect ratio (supports 16:9, 4:3, 3:4, 1:1)
    • -- --quality 80 — specify the JPEG quality (1-100, default 92)
    • -- --quality png — force PNG format (lossless but larger files)

How it works

  1. headless Chrome screenshots: render the HTML page by page as PNG images (supports #/N deep links)
  2. pptxgenjs assembly: embed the images into the PPTX in order, each filling a full page

Because it uses screenshots, the PPTX will 100% reproduce the visual effect of the HTML, including fonts, colors, layout, gradients, etc.

Command reference

# 自动检测页数
bash scripts/html-to-pptx.sh /path/to/deck/index.html

# 指定页数
bash scripts/html-to-pptx.sh /path/to/deck/index.html 8

# 4:3 宽高比
bash scripts/html-to-pptx.sh /path/to/deck/index.html all --ratio 4:3

# 指定 JPEG 质量(更小文件)
bash scripts/html-to-pptx.sh /path/to/deck/index.html all -- --quality 80

# 无损 PNG 格式
bash scripts/html-to-pptx.sh /path/to/deck/index.html all -- --quality png

The output file is in the same directory as the HTML, with the same filename but the extension .pptx。

Dependencies

  • Google Chrome: macOS default path /Applications/Google Chrome.app
  • pptxgenjs:npm install -g pptxgenjs

Notes

  • In the output PPTX, each page is an image,text is not editable(but the visual effect is perfectly reproduced)
  • If you need a PPTX with editable text, you should use the pptx skill to create it from scratch
  • Suitable scenarios: when you need to share html-ppt work with colleagues/clients who only accept PPTX format