npx skills add https://github.com/dnvriend/pdf-to-pptx-tool --skill skill-pdf-to-pptx-tool本技能提供使用 pdf-to-pptx-tool 的全面指导,这是一个专业的 CLI 工具,可将 PDF 文档转换为 PowerPoint 演示文稿。每个 PDF 页面都会成为一张高质量幻灯片,且分辨率可自定义。
在以下情况下使用此技能:
请勿在以下情况下使用此技能:
一个使用 Click 构建的现代 Python CLI 工具,具有多级详细日志记录、Shell 自动补全和类型安全代码。
# 克隆仓库
git clone https://github.com/dnvriend/pdf-to-pptx-tool.git
cd pdf-to-pptx-tool
# 使用 uv 全局安装
uv tool install .
This skill provides comprehensive guidance for using pdf-to-pptx-tool, a professional CLI tool that converts PDF documents into PowerPoint presentations. Each PDF page becomes a high-quality slide with customizable resolution.
Use this skill when:
Do NOT use this skill for:
A modern Python CLI tool built with Click, featuring multi-level verbosity logging, shell completion, and type-safe code.
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
poppler 系统库(用于 PDF 渲染)
brew install popplerapt-get install poppler-utils# 基本转换
pdf-to-pptx-tool convert document.pdf slides.pptx
# 高质量 (300 DPI)
pdf-to-pptx-tool convert report.pdf presentation.pptx --dpi 300
# 使用详细日志记录
pdf-to-pptx-tool -v convert input.pdf output.pptx
将 PDF 文档转换为 PowerPoint 格式,每个 PDF 页面创建一张幻灯片,并具有可自定义的质量设置。
用法:
pdf-to-pptx-tool convert INPUT_PDF OUTPUT_PPTX [OPTIONS]
参数:
INPUT_PDF: 输入 PDF 文件的路径(必需)
OUTPUT_PPTX: 输出 PowerPoint 文件的路径(必需)
.pptx--dpi INTEGER: 页面转换的分辨率(可选)
-v, --verbose: 多级详细程度
-v: INFO 级别(操作和进度)-vv: DEBUG 级别(详细步骤)-vvv: TRACE 级别(库内部信息)示例:
# 示例 1: 基本转换 (默认 200 DPI)
pdf-to-pptx-tool convert quarterly-report.pdf q4-presentation.pptx
# 示例 2: 高质量用于详细图表
pdf-to-pptx-tool convert technical-diagram.pdf slides.pptx --dpi 300
# 示例 3: 较低质量用于快速预览
pdf-to-pptx-tool convert draft.pdf preview.pptx --dpi 150
# 示例 4: 使用 INFO 日志记录查看进度
pdf-to-pptx-tool -v convert large-doc.pdf output.pptx
# 示例 5: 使用 DEBUG 日志记录进行故障排除
pdf-to-pptx-tool -vv convert problematic.pdf fixed.pptx
# 示例 6: 使用 Shell 循环进行批量转换
for pdf in *.pdf; do
pdf-to-pptx-tool convert "$pdf" "${pdf%.pdf}.pptx"
done
输出:
为 bash、zsh 或 fish shell 生成自动补全脚本。
用法:
pdf-to-pptx-tool completion SHELL
参数:
SHELL: Shell 类型(必需)
bash, zsh, fish示例:
# 生成 bash 自动补全
eval "$(pdf-to-pptx-tool completion bash)"
# 生成 zsh 自动补全
eval "$(pdf-to-pptx-tool completion zsh)"
# 生成 fish 自动补全
pdf-to-pptx-tool completion fish | source
# 保存到文件以永久安装
pdf-to-pptx-tool completion bash > ~/.pdf-to-pptx-tool-completion.bash
echo 'source ~/.pdf-to-pptx-tool-completion.bash' >> ~/.bashrc
输出: 打印到标准输出的 Shell 特定自动补全脚本。
该工具支持渐进式详细级别,用于调试和监控转换过程。
日志记录级别:
| 标志 | 级别 | 输出 | 使用场景 |
|---|---|---|---|
| (无) | WARNING | 仅错误/警告 | 生产环境,静默模式 |
-v | INFO | + 操作、进度 | 常规调试 |
-vv | DEBUG | + 详细步骤、文件大小 | 开发、故障排除 |
-vvv | TRACE | + 库内部信息 (pdf2image, PIL, pptx) | 深度调试 |
示例:
# 静默模式 - 仅查看错误
pdf-to-pptx-tool convert input.pdf output.pptx
# INFO - 查看转换进度
pdf-to-pptx-tool -v convert input.pdf output.pptx
# 输出:
# [INFO] 开始 PDF 到 PPTX 转换
# [INFO] 将 input.pdf 转换为 output.pptx (DPI: 200)
# [INFO] 将 PDF 页面转换为图像...
# [INFO] 已转换 5 页
# [INFO] 创建 PowerPoint 演示文稿...
# [INFO] 将演示文稿保存到 output.pptx
# DEBUG - 查看详细处理过程
pdf-to-pptx-tool -vv convert input.pdf output.pptx
# 额外输出:
# [DEBUG] 输入: input.pdf, 输出: output.pptx, DPI: 200
# [DEBUG] 验证输入文件: input.pdf
# [DEBUG] 输入文件大小: 2.45 MB
# [DEBUG] 使用 DPI 设置: 200
# [DEBUG] 处理幻灯片 1/5
# [DEBUG] 输出文件大小: 8.23 MB
# TRACE - 查看库内部信息
pdf-to-pptx-tool -vvv convert input.pdf output.pptx
# 显示 pdf2image、PIL 和 pptx 库的调试信息
根据您的使用场景选择 DPI:
| DPI | 质量 | 文件大小 | 最适合 |
|---|---|---|---|
| 72 | 低 | 最小 | 快速预览、草稿幻灯片 |
| 150 | 中 | 小 | 网页演示、电子邮件 |
| 200 | 良好 | 中 | 默认值 - 推荐用于大多数场景 |
| 300 | 高 | 大 | 打印质量、详细图表 |
| 600 | 非常高 | 非常大 | 专业打印、海报 |
权衡:
高效处理多个 PDF:
# 转换目录中的所有 PDF
for pdf in *.pdf; do
echo "正在转换 $pdf..."
pdf-to-pptx-tool convert "$pdf" "${pdf%.pdf}.pptx"
done
# 使用自定义 DPI
for pdf in *.pdf; do
pdf-to-pptx-tool convert "$pdf" "${pdf%.pdf}.pptx" --dpi 300
done
# 带错误处理
for pdf in *.pdf; do
if pdf-to-pptx-tool -v convert "$pdf" "${pdf%.pdf}.pptx"; then
echo "✓ 已转换 $pdf"
else
echo "✗ 转换 $pdf 失败"
fi
done
启用 Tab 自动补全以加快使用速度:
# Bash - 添加到 ~/.bashrc
eval "$(pdf-to-pptx-tool completion bash)"
# Zsh - 添加到 ~/.zshrc
eval "$(pdf-to-pptx-tool completion zsh)"
# Fish - 保存到自动补全目录
mkdir -p ~/.config/fish/completions
pdf-to-pptx-tool completion fish > ~/.config/fish/completions/pdf-to-pptx-tool.fish
好处:
pdf-to-pptx-tool <TAB>pdf-to-pptx-tool convert --<TAB>问题: "poppler not found" 或 PDF 转换失败
# 症状
RuntimeError: Failed to convert PDF pages: poppler not found
解决方案: 安装 poppler 系统库:
# macOS
brew install poppler
# Ubuntu/Debian
sudo apt-get install poppler-utils
# Fedora
sudo dnf install poppler-utils
# 验证安装
pdftoppm -v
问题: "File not found" 错误
# 症状
✗ Error: Input PDF file not found: document.pdf
解决方案:
验证文件路径是否正确
如果需要,使用绝对路径
检查文件权限
ls -l document.pdf
pdf-to-pptx-tool convert /full/path/to/document.pdf output.pptx
问题: 输出文件太大
# 症状
Generated 50MB PPTX from 2MB PDF
解决方案: 降低 DPI 设置:
# 尝试更低的 DPI
pdf-to-pptx-tool convert input.pdf output.pptx --dpi 150
# 或使用默认的 200 DPI
pdf-to-pptx-tool convert input.pdf output.pptx
问题: PowerPoint 中的图像看起来模糊
# 症状
Text and diagrams appear pixelated
解决方案: 提高 DPI 设置:
# 使用更高质量
pdf-to-pptx-tool convert input.pdf output.pptx --dpi 300
# 用于打印质量
pdf-to-pptx-tool convert input.pdf output.pptx --dpi 600
问题: 转换非常慢
# 症状
Large PDF takes minutes to convert
解决方案:
pdf-to-pptx-tool -vv convert large.pdf output.pptx
pdf-to-pptx-tool convert large.pdf output.pptx --dpi 150
问题: 写入输出文件时权限被拒绝
# 症状
PermissionError: [Errno 13] Permission denied: 'output.pptx'
解决方案:
检查目录写入权限
使用不同的输出位置
pdf-to-pptx-tool convert input.pdf ~/output.pptx
mkdir -p output-dir pdf-to-pptx-tool convert input.pdf output-dir/output.pptx
# 工具帮助
pdf-to-pptx-tool --help
# 命令帮助
pdf-to-pptx-tool convert --help
# 自动补全帮助
pdf-to-pptx-tool completion --help
# 版本信息
pdf-to-pptx-tool --version
当转换失败时,使用此调试工作流程:
# 1. 检查文件是否存在且可读
ls -lh document.pdf
file document.pdf
# 2. 验证 poppler 是否已安装
pdftoppm -v
# 3. 尝试使用 DEBUG 日志记录
pdf-to-pptx-tool -vv convert document.pdf test.pptx
# 4. 如果内存问题,尝试使用更低的 DPI
pdf-to-pptx-tool -vv convert document.pdf test.pptx --dpi 150
# 5. 检查 Python 和依赖项
python --version
pdf-to-pptx-tool --version
0: 成功 - 转换成功完成1: 错误 - 文件未找到、输入无效、转换失败或权限被拒绝默认 PowerPoint 输出:
控制台输出:
# 成功
✓ 成功将 document.pdf 转换为 slides.pptx
# 错误
✗ 错误: 输入 PDF 文件未找到: document.pdf
日志记录输出 (使用 -v/-vv/-vvv):
[INFO] 开始 PDF 到 PPTX 转换
[INFO] 将 document.pdf 转换为 slides.pptx (DPI: 200)
[DEBUG] 输入文件大小: 2.45 MB
[INFO] 已转换 10 页
[DEBUG] 输出文件大小: 12.78 MB
[INFO] 转换成功完成
-vv 显示详细的转换步骤每周安装数
136
仓库
首次出现
2026年1月22日
安全审计
安装于
opencode126
gemini-cli122
codex121
github-copilot118
cursor114
kimi-cli113
# Clone the repository
git clone https://github.com/dnvriend/pdf-to-pptx-tool.git
cd pdf-to-pptx-tool
# Install globally with uv
uv tool install .
poppler system library (for PDF rendering)
brew install popplerapt-get install poppler-utils# Basic conversion
pdf-to-pptx-tool convert document.pdf slides.pptx
# High quality (300 DPI)
pdf-to-pptx-tool convert report.pdf presentation.pptx --dpi 300
# With verbose logging
pdf-to-pptx-tool -v convert input.pdf output.pptx
Converts a PDF document to PowerPoint format, creating one slide per PDF page with customizable quality settings.
Usage:
pdf-to-pptx-tool convert INPUT_PDF OUTPUT_PPTX [OPTIONS]
Arguments:
INPUT_PDF: Path to input PDF file (required)
OUTPUT_PPTX: Path to output PowerPoint file (required)
.pptx--dpi INTEGER: Resolution for page conversion (optional)
-v, --verbose: Multi-level verbosity
-v: INFO level (operations and progress)-vv: DEBUG level (detailed steps)-vvv: TRACE level (library internals)Examples:
# Example 1: Basic conversion (default 200 DPI)
pdf-to-pptx-tool convert quarterly-report.pdf q4-presentation.pptx
# Example 2: High quality for detailed diagrams
pdf-to-pptx-tool convert technical-diagram.pdf slides.pptx --dpi 300
# Example 3: Lower quality for quick preview
pdf-to-pptx-tool convert draft.pdf preview.pptx --dpi 150
# Example 4: With INFO logging to see progress
pdf-to-pptx-tool -v convert large-doc.pdf output.pptx
# Example 5: With DEBUG logging for troubleshooting
pdf-to-pptx-tool -vv convert problematic.pdf fixed.pptx
# Example 6: Batch conversion with shell loop
for pdf in *.pdf; do
pdf-to-pptx-tool convert "$pdf" "${pdf%.pdf}.pptx"
done
Output:
Generates shell completion scripts for bash, zsh, or fish shells.
Usage:
pdf-to-pptx-tool completion SHELL
Arguments:
SHELL: Shell type (required)
bash, zsh, fishExamples:
# Generate bash completion
eval "$(pdf-to-pptx-tool completion bash)"
# Generate zsh completion
eval "$(pdf-to-pptx-tool completion zsh)"
# Generate fish completion
pdf-to-pptx-tool completion fish | source
# Save to file for permanent installation
pdf-to-pptx-tool completion bash > ~/.pdf-to-pptx-tool-completion.bash
echo 'source ~/.pdf-to-pptx-tool-completion.bash' >> ~/.bashrc
Output: Shell-specific completion script printed to stdout.
The tool supports progressive verbosity levels for debugging and monitoring conversions.
Logging Levels:
| Flag | Level | Output | Use Case |
|---|---|---|---|
| (none) | WARNING | Errors/warnings only | Production, quiet mode |
-v | INFO | + Operations, progress | Normal debugging |
-vv | DEBUG | + Detailed steps, file sizes | Development, troubleshooting |
-vvv | TRACE | + Library internals (pdf2image, PIL, pptx) | Deep debugging |
Examples:
# Quiet mode - only see errors
pdf-to-pptx-tool convert input.pdf output.pptx
# INFO - see conversion progress
pdf-to-pptx-tool -v convert input.pdf output.pptx
# Output:
# [INFO] Starting PDF to PPTX conversion
# [INFO] Converting input.pdf to output.pptx (DPI: 200)
# [INFO] Converting PDF pages to images...
# [INFO] Converted 5 pages
# [INFO] Creating PowerPoint presentation...
# [INFO] Saving presentation to output.pptx
# DEBUG - see detailed processing
pdf-to-pptx-tool -vv convert input.pdf output.pptx
# Additional output:
# [DEBUG] Input: input.pdf, Output: output.pptx, DPI: 200
# [DEBUG] Validating input file: input.pdf
# [DEBUG] Input file size: 2.45 MB
# [DEBUG] Using DPI setting: 200
# [DEBUG] Processing slide 1/5
# [DEBUG] Output file size: 8.23 MB
# TRACE - see library internals
pdf-to-pptx-tool -vvv convert input.pdf output.pptx
# Shows pdf2image, PIL, and pptx library debug messages
Choose DPI based on your use case:
| DPI | Quality | File Size | Best For |
|---|---|---|---|
| 72 | Low | Smallest | Quick previews, draft slides |
| 150 | Medium | Small | Web presentations, email |
| 200 | Good | Medium | Default - recommended for most |
| 300 | High | Large | Print quality, detailed diagrams |
| 600 | Very High | Very Large | Professional print, posters |
Trade-offs:
Process multiple PDFs efficiently:
# Convert all PDFs in directory
for pdf in *.pdf; do
echo "Converting $pdf..."
pdf-to-pptx-tool convert "$pdf" "${pdf%.pdf}.pptx"
done
# With custom DPI
for pdf in *.pdf; do
pdf-to-pptx-tool convert "$pdf" "${pdf%.pdf}.pptx" --dpi 300
done
# With error handling
for pdf in *.pdf; do
if pdf-to-pptx-tool -v convert "$pdf" "${pdf%.pdf}.pptx"; then
echo "✓ Converted $pdf"
else
echo "✗ Failed to convert $pdf"
fi
done
Enable tab completion for faster usage:
# Bash - add to ~/.bashrc
eval "$(pdf-to-pptx-tool completion bash)"
# Zsh - add to ~/.zshrc
eval "$(pdf-to-pptx-tool completion zsh)"
# Fish - save to completions directory
mkdir -p ~/.config/fish/completions
pdf-to-pptx-tool completion fish > ~/.config/fish/completions/pdf-to-pptx-tool.fish
Benefits:
pdf-to-pptx-tool <TAB>pdf-to-pptx-tool convert --<TAB>Issue: "poppler not found" or PDF conversion fails
# Symptom
RuntimeError: Failed to convert PDF pages: poppler not found
Solution: Install poppler system library:
# macOS
brew install poppler
# Ubuntu/Debian
sudo apt-get install poppler-utils
# Fedora
sudo dnf install poppler-utils
# Verify installation
pdftoppm -v
Issue: "File not found" error
# Symptom
✗ Error: Input PDF file not found: document.pdf
Solution:
Verify file path is correct
Use absolute paths if needed
Check file permissions
ls -l document.pdf
pdf-to-pptx-tool convert /full/path/to/document.pdf output.pptx
Issue: Output file is too large
# Symptom
Generated 50MB PPTX from 2MB PDF
Solution: Reduce DPI setting:
# Try lower DPI
pdf-to-pptx-tool convert input.pdf output.pptx --dpi 150
# Or use default 200 DPI
pdf-to-pptx-tool convert input.pdf output.pptx
Issue: Images look blurry in PowerPoint
# Symptom
Text and diagrams appear pixelated
Solution: Increase DPI setting:
# Use higher quality
pdf-to-pptx-tool convert input.pdf output.pptx --dpi 300
# For print quality
pdf-to-pptx-tool convert input.pdf output.pptx --dpi 600
Issue: Conversion is very slow
# Symptom
Large PDF takes minutes to convert
Solution:
pdf-to-pptx-tool -vv convert large.pdf output.pptx
pdf-to-pptx-tool convert large.pdf output.pptx --dpi 150
Issue: Permission denied writing output file
# Symptom
PermissionError: [Errno 13] Permission denied: 'output.pptx'
Solution:
Check directory write permissions
Use different output location
pdf-to-pptx-tool convert input.pdf ~/output.pptx
mkdir -p output-dir pdf-to-pptx-tool convert input.pdf output-dir/output.pptx
# Tool help
pdf-to-pptx-tool --help
# Command help
pdf-to-pptx-tool convert --help
# Completion help
pdf-to-pptx-tool completion --help
# Version info
pdf-to-pptx-tool --version
When conversion fails, use this debugging workflow:
# 1. Check file exists and is readable
ls -lh document.pdf
file document.pdf
# 2. Verify poppler is installed
pdftoppm -v
# 3. Try with DEBUG logging
pdf-to-pptx-tool -vv convert document.pdf test.pptx
# 4. Try with lower DPI if memory issues
pdf-to-pptx-tool -vv convert document.pdf test.pptx --dpi 150
# 5. Check Python and dependencies
python --version
pdf-to-pptx-tool --version
0: Success - conversion completed successfully1: Error - file not found, invalid input, conversion failed, or permission deniedDefault PowerPoint Output:
Console Output:
# Success
✓ Successfully converted document.pdf to slides.pptx
# Error
✗ Error: Input PDF file not found: document.pdf
Logging Output (with -v/-vv/-vvv):
[INFO] Starting PDF to PPTX conversion
[INFO] Converting document.pdf to slides.pptx (DPI: 200)
[DEBUG] Input file size: 2.45 MB
[INFO] Converted 10 pages
[DEBUG] Output file size: 12.78 MB
[INFO] Conversion completed successfully
-vv shows detailed conversion stepsWeekly Installs
136
Repository
First Seen
Jan 22, 2026
Security Audits
Installed on
opencode126
gemini-cli122
codex121
github-copilot118
cursor114
kimi-cli113
Lark Skill Maker 教程:基于飞书CLI创建AI技能,自动化工作流与API调用指南
39,100 周安装
Groove Work Plan:AI辅助代码库分析与项目计划生成工具 | 自动化开发流程
119 周安装
Groove Git日志自动化工具 - 自动生成每日Git提交摘要和变更记录
119 周安装
自媒体自动发布工具 - 支持百家号、知乎、公众号等平台一键发布,提升内容分发效率
105 周安装
Outlook自动化指南:通过Rube MCP与Composio工具包实现邮件、日历、联系人管理
83 周安装
WhoDB数据库助手:简化数据库操作,支持SQL查询、模式探索与数据导出
93 周安装
Xcode MCP 设置指南:连接 Claude、Cursor、VS Code 等 AI 助手到 Xcode 开发环境
101 周安装