← Back to Skills Marketplace
ahmed181283

Word to PDF Converter

by ahmed181283 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
36
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install docx-to-pdf
Description
Convert Word documents (.docx) to PDF format while preserving embedded images, formatting, and document structure. Use when user needs to convert Word files...
README (SKILL.md)

Word to PDF Converter

Quick Start

This skill converts Word documents (.docx) to PDF format, preserving embedded images, formatting, tables, and document structure.

When to Use This Skill

Use this skill when you need to:

  • Convert Word documents to PDF with images intact
  • Batch convert multiple .docx files to PDF
  • Preserve document formatting during conversion
  • Handle Word files with embedded images, charts, or complex layouts
  • Generate PDFs from Word templates or reports

Conversion Methods

Method 1: LibreOffice (Recommended)

Best for: Complex documents, highest fidelity, cross-platform Requirements: LibreOffice installed Pros: Free, handles complex formatting well, excellent image support Cons: Requires LibreOffice installation

Method 2: Python (python-docx + reportlab)

Best for: Programmatic conversion, custom formatting Requirements: Python with specific libraries Pros: Highly customizable, no external dependencies Cons: More complex setup, may miss some formatting

Method 3: Pandoc

Best for: Text-heavy documents, simple conversion Requirements: Pandoc installed Pros: Fast, widely available Cons: Limited image support, basic formatting

Method 4: docx2pdf (Python)

Best for: Quick conversions, good image support Requirements: Python with docx2pdf library Pros: Easy setup, good for most documents Cons: May struggle with very complex layouts

Usage

Basic Conversion

Convert document.docx to PDF

Batch Conversion

Convert all .docx files in current directory to PDF

Custom Output

Convert report.docx to PDF and name it monthly-report.pdf

Installation & Setup

LibreOffice Method

# Install LibreOffice
sudo apt-get install libreoffice

# Or on macOS
brew install --cask libreoffice

# Or on Windows
# Download from libreoffice.org

Python Method

# Install required libraries
pip install python-docx reportlab pillow

# Or use docx2pdf
pip install docx2pdf

Pandoc Method

# Install pandoc
sudo apt-get install pandoc

# Or on macOS
brew install pandoc

Conversion Commands

LibreOffice (Recommended)

# Single file conversion
libreoffice --headless --convert-to pdf document.docx

# Specify output directory
libreoffice --headless --convert-to pdf --outdir ./pdfs document.docx

# Batch convert
for file in *.docx; do
    libreoffice --headless --convert-to pdf "$file"
done

Python Method

from docx import Document
from docx2pdf import convert

# Convert with images preserved
convert("document.docx", "output.pdf")

Pandoc Method

# Basic conversion (limited image support)
pandoc document.docx -o output.pdf

# With better formatting
pandoc document.docx -o output.pdf --pdf-engine=xelatex

Features & Capabilities

What Gets Preserved

  • Embedded images and screenshots
  • Tables and cell formatting
  • Headers, footers, and page numbers
  • Font styles (bold, italic, underline)
  • Document structure and headings
  • Bullet points and numbered lists
  • Page layout and margins

Known Limitations

  • Very complex macros may not convert perfectly
  • Some advanced Word features may have PDF equivalents
  • Custom fonts may need to be installed
  • Extremely large documents may need memory tuning

Troubleshooting

Images Not Appearing

  1. Check that images are embedded, not linked
  2. Verify LibreOffice can open the source .docx
  3. Try LibreOffice method (best image support)
  4. Check disk space for large files

Formatting Issues

  1. LibreOffice method provides best results
  2. Verify document isn't corrupted
  3. Try opening in Word first to fix issues
  4. Use headless mode to avoid UI conflicts

Memory Issues with Large Files

# Increase LibreOffice memory (Linux)
soffice --headless -accept="socketsocket,host=localhost,port=2002;urp;" -nologo -nodefault -nofirststartwizard -nolockcheck -norestore -nocrashreport -nocrashreport -headless -invisible -convert-to pdf -nocrashreport -outdir /output /input

# Or split large document into parts before conversion

Font Issues

  • Install required system fonts
  • Use common fonts (Arial, Times, Helvetica) for better compatibility
  • Check LibreOffice font folder

Advanced Usage

Custom PDF Settings (LibreOffice)

# Export with specific settings
libreoffice --headless --convert-to pdf:writer_pdf_Export --infilter="writer_pdf_Export" document.docx

Python Script for Batch Processing

import os
from docx2pdf import convert

def convert_folder(input_dir, output_dir):
    os.makedirs(output_dir, exist_ok=True)
    for file in os.listdir(input_dir):
        if file.endswith('.docx'):
            input_path = os.path.join(input_dir, file)
            output_path = os.path.join(output_dir, file.replace('.docx', '.pdf'))
            convert(input_path, output_path)
            print(f"Converted: {file}")

convert_folder('./docs', './pdfs')

Quality Checklist

Before final conversion:

  • Source .docx opens without errors
  • Images are embedded (not external links)
  • Required fonts are installed
  • Sufficient disk space available
  • Test conversion with similar document first
  • Verify output PDF matches expected formatting

Output Quality Tips

  1. Test First: Always convert a sample document first
  2. Use LibreOffice: Best method for fidelity
  3. Check Images: Verify images appear correctly in output
  4. Batch Test: Test one file before batch conversion
  5. Keep Originals: Never delete source .docx files until PDF verified

Getting Help

For detailed conversion options and troubleshooting:

Usage Guidance
This skill is an instruction-only guide for converting .docx to PDF and appears internally consistent. Before using it: (1) review and run commands yourself rather than blindly allowing an agent to execute them—sudo apt-get / brew / pip installs require elevated privileges or change your environment; (2) prefer installing LibreOffice/Pandoc/docx2pdf from official repositories; (3) use a Python virtual environment for pip installs to avoid affecting system packages; (4) test conversion on a non-sensitive sample before batch-processing an entire directory, since batch commands will convert every .docx in the current folder; (5) check the odd 'socketsocket' token in the soffice example (likely a typo) before copying that line. The skill's source is unknown, so exercise standard caution with any system installs or automated execution.
Capability Analysis
Type: OpenClaw Skill Name: docx-to-pdf Version: 1.0.0 The skill bundle provides legitimate instructions and code snippets for converting Word documents to PDF using standard tools like LibreOffice, Pandoc, and the docx2pdf Python library. All commands in SKILL.md are consistent with the stated purpose of document processing, and there are no indicators of malicious intent, data exfiltration, or unauthorized system access.
Capability Assessment
Purpose & Capability
The name/description match the SKILL.md: all recommended tools (LibreOffice, python-docx/docx2pdf, Pandoc) and commands are appropriate for converting .docx to PDF. No unrelated credentials, binaries, or config paths are requested.
Instruction Scope
SKILL.md stays on-task (install/usage instructions and shell/python snippets to convert files). It suggests batch operations ('for file in *.docx') which can process any .docx in the current directory—users should be careful not to run batch conversions in directories with sensitive files. The memory-tuning soffice example includes a slightly odd 'socketsocket' token (likely a typo) but otherwise instructions reference only local files and local commands; no network exfiltration or external endpoints are specified.
Install Mechanism
No install spec or embedded code is provided—this is instruction-only. Install recommendations are to use standard package managers (apt, brew, pip), which is low-risk if users obtain packages from official sources.
Credentials
The skill requires no environment variables, no credentials, and no config paths. The recommended tools (LibreOffice, Pandoc, Python packages) justify the suggested installs; nothing requests access beyond what conversion needs.
Persistence & Privilege
always is false and the skill is user-invocable; it does not request persistent system presence, nor does it modify other skills or agent-wide config. It gives commands the user or agent would run interactively.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install docx-to-pdf
  3. After installation, invoke the skill by name or use /docx-to-pdf
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- Initial release of Word to PDF Converter skill. - Converts .docx files to PDF while preserving images, tables, and formatting. - Supports multiple conversion methods: LibreOffice (recommended), Python libraries, Pandoc, and docx2pdf. - Includes batch conversion, custom output naming, and troubleshooting guidance. - Provides detailed setup instructions for each method. - Lists best practices and common issues for high-quality PDF output.
Metadata
Slug docx-to-pdf
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Word to PDF Converter?

Convert Word documents (.docx) to PDF format while preserving embedded images, formatting, and document structure. Use when user needs to convert Word files... It is an AI Agent Skill for Claude Code / OpenClaw, with 36 downloads so far.

How do I install Word to PDF Converter?

Run "/install docx-to-pdf" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Word to PDF Converter free?

Yes, Word to PDF Converter is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Word to PDF Converter support?

Word to PDF Converter is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Word to PDF Converter?

It is built and maintained by ahmed181283 (@ahmed181283); the current version is v1.0.0.

💬 Comments