用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/publisher-skill/claude-skill --skill pdf-word-converter命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | pdf-word-converter |
| description | PDF与Word文档相互转换的skill,支持PDF转Word、Word转PDF |
| metadata | {"type":"custom"} |
PDF与Word文档相互转换工具。
pip install pdf2docx docx2pdf python-docx
注意:Word转PDF需要Microsoft Word (Windows) 或 LibreOffice (Linux/Mac)。
from claude_skills.pdf_word_converter import PdfWordConverter
converter = PdfWordConverter()
# PDF转Word
converter.pdf_to_word("input.pdf", "output.docx")
# Word转PDF
converter.word_to_pdf("input.docx", "output.pdf")
# 批量转换文件夹
converter.convert_folder("input_dir", "output_dir", "pdf2word")
# PDF转Word
python converter.py pdf2word input.pdf output.docx
# Word转PDF
python converter.py word2pdf input.docx output.pdf
# 批量转换
python converter.py folder input_dir output_dir --mode pdf2word
__init__()初始化转换器。
pdf_to_word(pdf_path, docx_path, start=0, end=None)将PDF转换为Word文档。
参数:
pdf_path (str): 输入PDF文件路径docx_path (str): 输出Word文件路径start (int, optional): 起始页码(从0开始)end (int, optional): 结束页码word_to_pdf(docx_path, pdf_path)将Word文档转换为PDF。
参数:
docx_path (str): 输入Word文件路径pdf_path (str): 输出PDF文件路径convert_folder(input_dir, output_dir, mode)批量转换文件夹中的文档。
参数:
input_dir (str): 输入文件夹路径output_dir (str): 输出文件夹路径mode (str): 转换模式,'pdf2word' 或 'word2pdf'