word2pdf
Skill8 starsChanged 3 months agoMITView on GitHub
Convert Word (.doc / .docx) to PDF. Auto-detects binary .doc (OLE2) vs .docx (Office Open XML) via magic bytes, then converts using Microsoft Word COM or LibreOffice headless. Use when user mentions "word2pdf", "Word转PDF", "Word to PDF", "doc转PDF", "docx转PDF", or needs to convert a Word document to PDF.
- Installs packages
In this repository32 other files it gives its agents.
- ai-genSkill
- any2mdSkill
- assignment-wordSkill
- cheatsheatSkill
- claude2antiSkill
- claude2codexSkill
- codex2claudeSkill
- fincomp-deckSkill
- github-trendingSkill
- git-pushSkill
- html2mdSkill
- html2pdfSkill
- html2texSkill
- html-slidesSkill
- img-readerSkill
- latex-beamerSkill
- markitdownSkill
- md2docxSkill
- md2texSkill
- mergeSkill
- notesSkill
- paper-html-onepageSkill
- paper-reproSkill
- pdf2wordSkill
- pdf-readerSkill
- posterSkill
- repo-docsSkill
- repo-docs-zhSkill
- resume-builderSkill
- web-search-fallbackSkill
- word2htmlSkill
- word2mdSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 64
If unavailable, try LibreOffice headless
- Very specific: line 69
Always use PYTHONIOENCODING=utf-8 on Windows
- Distinctive: line 72
If neither Word nor LibreOffice is available, inform the user to install one
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Word to PDF Converter
Convert Word documents (.doc / .docx) to PDF with automatic format detection.
When to Use
- User mentions: "word2pdf", "Word转PDF", "Word to PDF", "doc转PDF", "docx转PDF"
- Need to convert a Word document to PDF for sharing or submission
- Need to check whether a file is .doc or .docx before converting
How It Works
- Format Detection — reads first 8 bytes to identify:
D0 CF 11 E0 ...→.doc(OLE2 Compound Binary Format)50 4B 03 04→.docx(ZIP / Office Open XML)
- Conversion — tries in order:
- Microsoft Word COM automation (
win32com) — best fidelity for both formats - LibreOffice headless (
soffice --headless) — fallback for both formats
- Microsoft Word COM automation (
Usage
python "<LOCAL_USER>/.claude/skills/word2pdf/word2pdf.py" <input.doc|input.docx> [output.pdf]Arguments
| Argument | Required | Description |
input | Yes | Input Word file path (.doc or .docx) |
output | No | Output PDF path (default: same name with .pdf extension) |
Examples
# Convert .docx (auto-detect format, output = input_name.pdf)
python "<LOCAL_USER>/.claude/skills/word2pdf/word2pdf.py" "report.docx"
# Convert .doc (legacy binary format)
python "<LOCAL_USER>/.claude/skills/word2pdf/word2pdf.py" "old_document.doc"
# Convert with custom output path
python "<LOCAL_USER>/.claude/skills/word2pdf/word2pdf.py" "report.docx" "output.pdf"Dependencies
- Primary: Microsoft Word (installed) +
pywin32python -m pip install pywin32 - Fallback: LibreOffice (any recent version)
Workflow
- Validate input file exists
- Detect format via magic bytes (report
.docor.docx) - Try Microsoft Word COM conversion
- If unavailable, try LibreOffice headless
- Report output path, file size, and page count
Rules
- Always use
PYTHONIOENCODING=utf-8on Windows - Report detected format to user before converting
- Report any conversion warnings or errors
- If neither Word nor LibreOffice is available, inform the user to install one
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

