name: pdf-to-ppt description: | Convert PDF files to PowerPoint presentations via intermediate image rendering. Created collaboratively with 贾维斯 (AI assistant) by Hugo. Use when working with PDF documents that are primarily visual (e.g., design drawings, presentations scanned to PDF, etc.) and preserves the visual layout faithfully.
This skill converts PDF files into PowerPoint presentations by first rendering each PDF page as a high-quality image, then assembling those images into a PPT where each image fills a slide. This approach works well for PDFs that are primarily visual (e.g., design drawings, presentations scanned to PDF, etc.) and preserves the visual layout faithfully.
Use this skill when you need to: - Convert a PDF document into an editable PowerPoint presentation. - Preserve the exact visual layout of each PDF page (text, images, vectors) as slide backgrounds. - Work with PDFs that are not easily editable via direct text extraction (e.g., complex layouts, designer files). - Batch-convert multiple PDFs to PPT format.
小葱技能站7w4.net发现了升级插件。
PyMuPDF (fitz) and python-pptx.To install this skill from a local path (after copying to your skills folder), you can use:
clawhub install /path/to/pdf-to-ppt
Or if you have cloned the skill repository:
clawhub install pdf-to-ppt
python3 scripts/pdf_to_ppt.py input.pdf
This will:
- Create an images/ subdirectory next to the input PDF (or use a specified directory).
- Render each PDF page to a PNG image in that folder.
- Generate a PPT file with the same base name as the input PDF, appended with .pptx, in the same directory as the input.
python3 scripts/pdf_to_ppt.py input.pdf \
--img-dir /path/to/images \
--output output.pptx \
--zoom 3.0 \
--slide-width-in 16 \
--slide-height-in 9 \
--format png
input.pdf: Path to the source PDF file (required).--img-dir DIR: Directory to store intermediate images. If not provided, defaults to <pdf_dir>/images/.--output PPTX: Path for the output PPT file. If not provided, defaults to <pdf_basename>.pptx in the same directory as input PDF.--zoom ZOOM: Zoom factor for rendering (default 2.0). Higher = higher DPI.--slide-width-in INCHES: Width of slides in inches (default 13.33 for 16:9 at 7.5in height).--slide-height-in INCHES: Height of slides in inches (default 7.5).--format {png,jpg}: Image format for intermediates (default png).python3 scripts/pdf_to_ppt.py report.pdf \
--img-dir ./tmp/imgs \
--output ./presentation.pptx \
--zoom 2.5 \
--format jpg
--zoom.bash
for pdf in *.pdf; do
python3 scripts/pdf_to_ppt.py "$pdf"
donebash
pip install --break-system-packages PyMuPDF python-pptx
(Add --break-system-packages if using system Python in a restricted environment.)Consider combining with:
- pdf-tools — for extracting text, merging, splitting PDFs before conversion.
- powerpoint-pptx — for best practices on editing and styling the resulting PPT.
- images — if you need to process the intermediate images further.
If you find this skill useful, consider starring it on ClawHub: clawhub star pdf-to-ppt
For issues or enhancements, please refer to the skill’s source repository.
This skill was created to automate PDF → image → PPT conversion for visual-rich documents.
这个 Skill 质量良好,能够可靠地将 PDF 转换为 PPT,文档清晰易懂,参数说明详细,错误提示友好。脚本运行逻辑简单明了,适合有技术背景的用户使用。主要不足是缺少自动安装依赖的机制,用户需要手动安装第三方库;另外没有内置批量转换功能,处理多个文件时稍显不便。整体而言,是一个实用且质量可靠的转换工具。