CLI tool
ArtifexSoftware/pdf2docx avatar
ArtifexSoftware/pdf2docx

pdf2docx: a Python library for turning PDFs into editable DOCX files

Open source Python library for converting PDF to DOCX.

3,544 stars505 forksPythonMIT

At a glance

What is it?
pdf2docx converts PDF pages into DOCX through PyMuPDF parsing and python-docx writing, and it also extracts tables. Artifex has stopped active development, so the MIT licence and the code are what you get. Here is how it installs, what it converts well, and where it breaks.
Who is it for?
Adopt pdf2docx if you need scripted PDF to DOCX conversion or table extraction inside a Python pipeline, and you can pin PyMuPDF and accept an unmaintained dependency. Do not adopt it if you need a maintained converter or a hosted service; the README states Artifex no longer provides active development.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Activity is slowing. The repository last received commits 6 months ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 22, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • ArtifexSoftware/pdf2docx3,544 ★ · +24
Star history
Repository2026-09-242026-11-22
ArtifexSoftware/pdf2docx3.5k3.5k

24 Stars in the last 59 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The gap pdf2docx fills: PDF in, editable DOCX out

PDF is a fixed-layout format. A PDF file records where each glyph, line and image sits on the page, not the paragraphs, headings or table cells that produced that layout. DOCX is the opposite: it stores structure. Moving from one to the other means reconstructing structure from geometry, and that reconstruction is the actual work. pdf2docx targets that gap for Python users who need the output as a file they can edit in Word or LibreOffice, or as data they can process further.

The repository describes itself in setup.py as an "Open source Python library converting pdf to docx", and the package keywords are pdf-to-word and pdf-to-docx. The audience is narrow and specific: developers writing conversion scripts, data engineers pulling tables out of reports, and anyone who would otherwise open a PDF and retype it. It is not aimed at end users who want a drag-and-drop desktop tool, although the documentation links a GUI page alongside the CLI and API pages.

How conversion works: PyMuPDF reads, python-docx writes

The dependency list in requirements.txt tells most of the architecture story. PyMuPDF>=1.26.7 does the PDF parsing: it exposes text spans, drawing commands and image blocks with coordinates. python-docx>=0.8.10 writes the output document. Between those two, the library has to decide what a group of text spans on a page means in DOCX terms, and that is where opencv-python-headless>=4.5 and numpy>=1.17.2 come in. Both are listed as dependencies, which points to image processing and array work inside the layout analysis rather than only in the PDF reader.

fonttools>=4.24.0 is there for font handling, which matters because a PDF may embed a subset of a typeface with no usable family name. fire>=0.3.0 is the CLI layer: setup.py registers a console script named pdf2docx that points at pdf2docx.main:main, and Fire is what turns that entry point into a command tree. The package is installed with include_package_data=True and zip_safe=False, and the Makefile shows the build path: python setup.py sdist and bdist_wheel for release artifacts, with tests driven from a Makefile under test/.

The practical consequence of this design is that conversion quality tracks PyMuPDF's text extraction quality. Scanned pages with no text layer are not a text problem at all, and nothing in the listed dependencies is an OCR engine.

Installing pdf2docx with pip and converting a first file

The README points to the installation page of the Read the Docs site, and setup.py declares python_requires=">=3.10". Install from PyPI with pip, which pulls the six packages in requirements.txt:

bash
pip install pdf2docx

The console script registered in setup.py is called pdf2docx, and the README's documentation index lists a Command Line Interface page. The README does not print a CLI invocation, so read that page for the exact arguments before scripting it. The README's Quickstart section links a Convert PDF page, which is where the Python API is documented; the README itself contains no code sample, so follow that page for the exact class and method names:

text
https://pdf2docx.readthedocs.io/en/latest/quickstart.convert.html

Table extraction is a separate documented path. The Quickstart section has an Extract table page, and the repository topics include extract-table, so the same library that writes DOCX can also return tables rather than document objects. The README shows no code for that path either; check the Read the Docs pages for the exact method names and arguments before you build a pipeline around them.

Where the conversion model breaks down

The hard limit is the PDF itself. If a page has no text layer, there is nothing for PyMuPDF to extract and no OCR dependency in requirements.txt to fall back on. A scanned contract is the wrong input for this library.

The second limit is structural ambiguity. When a PDF was produced by a layout engine that placed text at absolute coordinates, pdf2docx has to infer reading order, paragraph breaks and column boundaries from position. Multi-column academic papers, sidebars, footnotes and text wrapped around figures are exactly the cases where geometry is least decisive. The library will produce a DOCX file in those cases; whether the paragraphs come out in the order a human would read them is a separate question, and the README makes no accuracy claim.

The third limit is maintenance. The README carries a Project Status notice stating that pdf2docx "is no longer actively maintained by Artifex", that the repository remains available under the MIT License so the community can fork it, and that Artifex no longer provides active development or maintenance. Pull requests are welcome, but there is no vendor commitment behind bug fixes. The last push to the repository was on 2026-05-01, which is the date of the v0.5.13 release; the two prior releases, v0.5.11 and v0.5.12, landed in March 2026. Treat the dependency chain as the risk: PyMuPDF moves faster than this project now does, and a future PyMuPDF release could break compatibility with no upstream fix.

pdf2docx compared with the tools Artifex now points to

The README's own recommendation is the clearest alternative. It suggests PyMuPDF or MuPDF.NET if you want a full-featured PDF processing library. The difference in approach is fundamental: PyMuPDF gives you the parsed document model, page objects, text extraction, and drawing access, and leaves the decision about what to do with that content to you. pdf2docx is a layer on top of PyMuPDF that makes one specific decision for you, namely how to map a page onto DOCX paragraphs, runs and tables.

That means choosing PyMuPDF directly is more work but not less capability. If your output format is not DOCX, or if you need to control paragraph merging yourself, the higher-level library is an extra abstraction you will fight. If your output is DOCX and you want the layout heuristics already written, pdf2docx saves that work, at the cost of depending on a project Artifex has stepped back from.

A second class of alternative is the hosted converter, which the search data reflects in queries like "pdf2docx online free". There is no hosted service in this repository. The homepage is the Read the Docs site, and the only interfaces documented are the Python API, the CLI and a GUI page. Uploading a document to a third-party converter is a different trust model from running pip install locally, and for confidential PDFs the local library is the only one of the two that keeps the file on your machine.

Licence and the cost of an unmaintained dependency

The repository is MIT licensed. setup.py declares license="MIT" and the README confirms the project was relicensed under the MIT License so the community can use, fork and maintain it. MIT is permissive: it allows commercial use, modification and redistribution, and it requires that the copyright notice and permission notice be included. Read the LICENSE file at the repository root for the exact text rather than relying on the SPDX identifier alone, and check the licences of the six dependencies separately, because PyMuPDF, python-docx, fonttools, numpy, opencv-python-headless and fire each carry their own terms.

The upgrade cost is the part that deserves attention. Because Artifex no longer provides active development, version bumps will come from community pull requests or not at all. Pinning the dependency set in your own requirements file is the practical mitigation, and the floor versions in requirements.txt give you a starting point. If you need a fix for a PyMuPDF incompatibility, the fork path is open under MIT, but you are then maintaining a converter. That is a real budget line, not a hypothetical one.

Editorial conclusion

Adopt pdf2docx if you need scripted PDF to DOCX conversion or table extraction inside a Python pipeline, and you can pin PyMuPDF and accept an unmaintained dependency. Do not adopt it if you need a maintained converter or a hosted service; the README states Artifex no longer provides active development. Before committing, verify the conversion result on your own sample pages, check that your Python is 3.10 or newer, and read the MIT licence text in LICENSE to confirm what your redistribution requires.

Frequently asked questions

How do I install pdf2docx?

Install it from PyPI with pip install pdf2docx. setup.py declares python_requires=">=3.10", so use Python 3.10 or newer. The install pulls the six packages listed in requirements.txt, including PyMuPDF and python-docx.

How do I use pdf2docx to convert a PDF?

The README links a Quickstart page with a Convert PDF section, which is where the Python API is documented. setup.py also registers a pdf2docx console script, and the documentation index includes a Command Line Interface page.

Is pdf2docx safe to use?

It is an MIT licensed Python package that runs locally, so the PDF is not uploaded anywhere. It depends on PyMuPDF, python-docx, fonttools, numpy, opencv-python-headless and fire, each with its own licence. The README states Artifex no longer provides active development or maintenance.

What is a pdf2docx alternative?

The README itself points to PyMuPDF or MuPDF.NET for full-featured PDF processing. Those give you the parsed document model and leave the DOCX mapping to you, whereas pdf2docx makes that mapping decision for you on top of PyMuPDF.

Official sources

  1. ArtifexSoftware/pdf2docx on GitHub
  2. License: MIT
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/artifexsoftware-pdf2docx.svg)](https://hysenlabs.com/projects/artifexsoftware-pdf2docx)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/artifexsoftware-pdf2docx.svg)](https://hysenlabs.com/projects/artifexsoftware-pdf2docx)

Was this useful?