Convert PDF to DOCX using PHP

High-speed, powerful, and secure API for converting PDF files to DOCX documents in PHP


PDF to DOCX API is an incredible tool that converts either scanned or textual PDF documents to editable MS Office Word DOCX files.

Convert PDF to DOCX programmatically

Our PDF to DOCX converter is a powerful API tool that enables users to convert PDF (Portable Document Format) files into editable DOCX (Microsoft Word) documents. With this tool, you can easily manipulate and edit the content of a PDF document in a docx processing program like Microsoft Word. Not only does this tool simplify converting PDF documents into Microsoft Word-compatible DOCX files, but it also preserves the layout and formatting of the original document as closely as possible.

Install the ConvertAPI library to any PHP project

Our PDF to DOCX converter is available as a REST API service, but we also offer a PHP library that can be easily integrated into your project. You can access the ConvertAPI library through Composer, and the source code is available on GitHub. To install the library, simply run the following command in your project's root directory:

composer require convertapi/convertapi-php

Should you wish to install ConvertApi manually, you'll need to require the ConvertApi autoloader:


If you choose not to use the Composer, it's important to install the following dependencies for our library to work properly:

Convert PDF to DOCX using PHP

If you have the library installed, you can use this PHP code snippet to convert a PDF to a DOCX:

require __DIR__ . '/../lib/ConvertApi/autoload.php';

use \ConvertApi\ConvertApi;

# Code snippet is using the ConvertAPI PHP Client:
# Read more about PDF to DOCX API:

$result = ConvertApi::convert('docx', [
        'File' => '/path/to/my_file.pdf',
    ], 'pdf'

Converting PDF to DOCX has never been easier with the help of the ConvertAPI library for PHP. It is effortless and straightforward! The library allows you to convert local files, documents hosted on a server accessible through a public URL, and files uploaded to our server that are accessible by FileId.


By converting PDF to DOCX you gain the ability to modify the contents of the document, extract data from your original file, or create new documents based on the existing layout and formatting. Turning static PDF documents into MS Office Word using PHP has never been simpler!

You can find the conversion parameters on our interactive demo page, where you can fine-tune the conversion to output the best result possible. If you want to master our library like a PRO, we encourage you to check our advanced techniques and examples on GitHub, which covers every possible case you can think of!