docx2pdf
Convert docx to pdf on Windows or macOS directly using Microsoft Word (must be installed).
What it is and what it does
docx2pdf is a lightweight automation wrapper that converts Microsoft Word DOCX files to PDF by delegating to Word itself rather than reimplementing document rendering. On Windows it uses win32com to drive Word via COM, and on macOS it uses AppleScript (JXA) to control Word through native OS automation. The package works both as a command-line tool and as a Python library, supporting single-file conversion, batch folder conversion, and explicit output path specification.
Because it relies on Word's own PDF export rather than a document parser, it preserves formatting, fonts, and complex layouts accurately. The trade-off is a hard dependency on having Microsoft Word installed on the conversion machine—it cannot work in headless environments or on systems without Word. The package is aging (last release December 2021) and shows no recent maintenance activity, though it remains stable for its narrow use case.
Use it for:
- Batch convert folders of DOCX files to PDF on a Windows or macOS workstation where Word is already installed.
- Automate DOCX-to-PDF conversion in Python scripts or Jupyter notebooks without implementing document parsing.
- Preserve complex Word formatting (styles, embedded objects, fonts) that simpler converters might lose or misrender.
- Command-line bulk conversion of DOCX files with optional output directory specification.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts DOCX files to PDF on Windows or macOS by automating Microsoft Word through native OS APIs (win32com on Windows, AppleScript on macOS).
Yes, if you have Microsoft Word installed on Windows or macOS and need reliable DOCX-to-PDF conversion with formatting preservation. The low install friction and permissive MIT license make it straightforward to try. However, the aging maintenance status (last release December 2021, no recent commits) means you should verify compatibility with your current Word version before relying on it in production. Not suitable for headless or server-side conversion.
Install
docx2pdf on PyPI
pip
pip install docx2pdfuv
uv add docx2pdfpoetry
poetry add docx2pdfInstalling docx2pdf
Before you install
Low install friction with a pure-Python wheel. Maintenance is aging—last release was 2021-12-11 and the repository shows no recent activity despite 602 stars—but the package remains archived-free and dependencies are stable.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
pip install docx2pdf
from docx2pdf import convert
convert("input.docx")
convert("input.docx", "output.pdf")
convert("my_docx_folder/")
Microsoft Word must be installed on the target system (Windows or macOS); the package is a thin automation wrapper around Word's native conversion capability.
Verify before relying
- Whether the package works reliably with recent versions of Microsoft Word on Windows and macOS.
- Whether tqdm progress bar rendering in Jupyter requires ipywidgets as stated in the description or if it's optional.
- Current state of pywin32 and appscript dependencies and their compatibility with modern OS versions.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.5) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — pywin32, tqdm, importlib_metadata, appscript |
| Maintenance | aging — 1,707 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 932,618/month — #4,699 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: docx2pdf-0.1.8-py3-none-any.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
doc2docxConverts legacy .doc files to modern .docx…
permissive · top 15,000 on PyPI
pdf2docxConverts PDF files to Word documents (.docx…
permissive · top 5,000 on PyPI
pyhwpxAutomates HWP (아래아한글) document creation and…
unclear · top 15,000 on PyPI
cloudmersive-convert-api-clientA Python client library for the Cloudmersive…
unclear · top 15,000 on PyPI
html2docxConverts valid HTML to Microsoft Word (.docx)…
permissive · top 15,000 on PyPI
spire-docSpire.Doc creates, reads, modifies, and…
unclear · top 15,000 on PyPI
pdfservices-sdkClient library for Adobe PDF Services API,…
permissive · top 15,000 on PyPI
python-hwpxReads, edits, and creates HWPX documents…
permissive · top 15,000 on PyPI
docxCreates, reads, and writes Microsoft Office…
unclear · top 15,000 on PyPI
docx-mailmerge2Performs mail merge operations on docx files by…
permissive · top 15,000 on PyPI