PHPackages                             codeinc/office2pdf-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. codeinc/office2pdf-client

Abandoned → [codeinc/document-cloud-client](/?search=codeinc%2Fdocument-cloud-client)ArchivedLibrary[API Development](/categories/api)

codeinc/office2pdf-client
=========================

A PHP client for the office2pdf API

v1.9(1y ago)023MITPHPPHP &gt;=8.3

Since Feb 23Pushed 1y ago1 watchersCompare

[ Source](https://github.com/codeinchq/office2pdf-php-client)[ Packagist](https://packagist.org/packages/codeinc/office2pdf-client)[ Docs](https://github.com/codeinchq/office2pdf-php-client)[ RSS](/packages/codeinc-office2pdf-client/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (6)Versions (11)Used By (0)

Office2Pdf PHP client
=====================

[](#office2pdf-php-client)

[![Code Inc.](https://camo.githubusercontent.com/b56d4c5954d5effd14ce91dccae0307eb8dadc9ab1e2571a3816295b9ea98d06/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6465253230496e632e2d4f6666696365325064662d626c7565)](https://github.com/codeinchq/office2pdf)[![Tests](https://github.com/codeinchq/office2pdf-php-client/actions/workflows/phpunit.yml/badge.svg)](https://github.com/codeinchq/office2pdf-php-client/actions/workflows/phpunit.yml/badge.svg)

Important

This client is deprecated and is replaced by the [Document Cloud PHP Client](https://github.com/codeinchq/document-cloud-php-client)

This repository contains a PHP 8.2+ library for converting Office files to PDF using the [office2pdf](https://github.com/codeinchq/office2pdf) service.

Installation
------------

[](#installation)

The library is available on [Packagist](https://packagist.org/packages/codeinc/office2pdf-client). The recommended way to install it is via Composer:

```
composer require codeinc/office2pdf-client
```

Usage
-----

[](#usage)

This client requires a running instance of the [office2pdf](https://github.com/codeinchq/office2pdf) service. The service can be run locally [using Docker](https://hub.docker.com/r/codeinchq/office2pdf) or deployed to a server.

### Example:

[](#example)

```
use CodeInc\Office2PdfClient\Office2PdfClient;
use CodeInc\Office2PdfClient\ConvertOptions;
use CodeInc\Office2PdfClient\Format;

$apiBaseUri = 'http://localhost:3000/';
$srcDocPath = '/path/to/local/file.docx';
$destPdfPath = '/path/to/local/file.pdf';
$convertOption = new ConvertOptions(
    firstPage: 2,
    lastPage: 3,
    format: Format::json
);

try {
    $client = new Office2PdfClient($apiBaseUri);

    // convert
    $pdfStream = $client->convert(
        $client->createStreamFromFile($srcDocPath),
        $convertOption
    );

   // save the PDF
   $client->saveStreamToFile($pdfStream, $destPdfPath);
}
catch (Exception $e) {
    // handle exception
}
```

#### Validating the support of a file format:

[](#validating-the-support-of-a-file-format)

```
use CodeInc\Office2PdfClient\Office2PdfClient;
use CodeInc\Office2PdfClient\Exception;

$filename = 'a-file.docx';

$client = new Office2PdfClient('http://localhost:3000/');

$client->isSupported("a-file.docx"); // returns true
$client->isSupported("a-file"); // returns true
$client->isSupported("a-file", false); // returns false (the second argument is the strict mode)
$client->isSupported("a-file.pdf"); // returns false
```

License
-------

[](#license)

The library is published under the MIT license (see [`LICENSE`](LICENSE) file).

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~32 days

Recently: every ~1 days

Total

10

Last Release

570d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ce6d7fd91f537008e6af8eef5f5529e994cf74be8d78ee7b9d9ecac476ba1444?d=identicon)[joanfabregat](/maintainers/joanfabregat)

![](https://www.gravatar.com/avatar/8f72f949d7f70e400c02c225685f1934dec6219689f25edec38b4037df166d58?d=identicon)[codeinc](/maintainers/codeinc)

---

Top Contributors

[![joanfabregat](https://avatars.githubusercontent.com/u/4227907?v=4)](https://github.com/joanfabregat "joanfabregat (31 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/codeinc-office2pdf-client/health.svg)

```
[![Health](https://phpackages.com/badges/codeinc-office2pdf-client/health.svg)](https://phpackages.com/packages/codeinc-office2pdf-client)
```

###  Alternatives

[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k28.0M318](/packages/openai-php-client)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

35789.4k2](/packages/telnyx-telnyx-php)[deeplcom/deepl-php

Official DeepL API Client Library

2607.3M114](/packages/deeplcom-deepl-php)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M737](/packages/sylius-sylius)[mailgun/mailgun-php

The Mailgun SDK provides methods for all API functions.

1.1k30.8M182](/packages/mailgun-mailgun-php)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

1003.9M50](/packages/getbrevo-brevo-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
