PHPackages                             zamzar/zamzar-php - 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. zamzar/zamzar-php

ActiveLibrary[API Development](/categories/api)

zamzar/zamzar-php
=================

Zamzar PHP Library

v2.2.0(11mo ago)556.8k↓58.1%4[5 issues](https://github.com/zamzar/zamzar-php/issues)MITPHPPHP &gt;=7.2.34CI passing

Since May 7Pushed 11mo ago5 watchersCompare

[ Source](https://github.com/zamzar/zamzar-php)[ Packagist](https://packagist.org/packages/zamzar/zamzar-php)[ Docs](https://www.zamzar.com/)[ RSS](/packages/zamzar-zamzar-php/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (2)Versions (13)Used By (0)

PHP file converter library for Zamzar
=====================================

[](#php-file-converter-library-for-zamzar)

[![@zamzar on Twitter](https://camo.githubusercontent.com/d17b36c3768508ad6388d94292fe2133087ae163542e8f192208dd2356ee94d6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f747769747465722d7a616d7a61722d626c7565)](https://twitter.com/zamzar)[![Total Downloads](https://camo.githubusercontent.com/197cc846b65521cfed2d56f3e268da9197f9100f338662bf2f83e0ddaa87377c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a616d7a61722f7a616d7a61722d7068702e7376673f7374796c653d666c6174)](https://packagist.org/packages/zamzar/zamzar-php)[![Apache 2 License](https://camo.githubusercontent.com/a6ceafec7e79d3739913e6914f3b24e800282b0fb6dbe176ac314782c7db2182/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7a616d7a61722f7a616d7a61722d7068702e7376673f7374796c653d666c6174)](https://github.com/zamzar/zamzar-php/blob/main/LICENSE)

Easy to use PHP file conversion API with support for 1,100+ file conversions - convert documents, audio, images, video, eBooks and more. Use `zamzar-php` to convert files between different formats as part of your PHP application with the [Zamzar file conversion API](https://developers.zamzar.com). Common use cases include:

- Convert Microsoft Word (DOCX, DOC) to PDF
- Extract text from PDF files
- Convert Powerpoint (PPT, PPTX) to JPG
- Archive email (MSG files) to PDF

This is the official PHP SDK for the [Zamzar file conversion API](https://developers.zamzar.com).

Jump to:

- [Requirements](#requirements)
- [Installation](#installation)
- [Initialise the Zamzar Client](#initialise-the-zamzar-client)
- [Test the Connection](#test-the-connection)
- [Typical Usage](#typical-usage)
- [Configure a Logger](#configure-a-logger)
- [Resources](#resources)

Requirements
------------

[](#requirements)

- Before you begin, signup for a Zamzar API Account or retrieve your existing API Key from the [Zamzar Developers Homepage](https://developers.zamzar.com/user)
- PHP 7.2.34 and later.

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

[](#installation)

You can install the bindings via [Composer](http://getcomposer.org/). Run the following command:

```
composer require zamzar/zamzar-php
```

To use the bindings, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading):

```
require_once('vendor/autoload.php');
```

Initialise the Zamzar Client
----------------------------

[](#initialise-the-zamzar-client)

To initialise the client, declare a new ZamzarClient:

```
// Connect to the Production API using an API Key
$zamzar = new \Zamzar\ZamzarClient([
    'api_key' => 'apiKey',
    'transport' => \Zamzar\ZamzarClient::recommendedTransport()
]);
```

To specify whether the client using the Production or Test API, use a Config array:

```
// Use the Production API
$zamzar = new \Zamzar\ZamzarClient([
    'api_key' => 'apiKey',
    'environment' => 'production',
    'transport' => \Zamzar\ZamzarClient::recommendedTransport()
]);

// Use the Sandbox API
$zamzar = new \Zamzar\ZamzarClient([
    'api_key' => 'apiKey',
    'environment' => 'sandbox',
    'transport' => \Zamzar\ZamzarClient::recommendedTransport()
]);
```

Test the Connection
-------------------

[](#test-the-connection)

To confirm your credentials are correct, test the connection to the API which will return a welcome message and confirm which API you are using (Production or Test).

```
echo $zamzar->testConnection();
```

Typical Usage
-------------

[](#typical-usage)

The most common requirement is to submit a job to convert a file, wait for the job to complete, download the converted files and delete the files on Zamzar servers.

```
// Submit the file
$job = $zamzar->jobs->create([
    'source_file' => 'path/to/local/file',
    'target_format' => 'xxx'
]);

// Wait for the job to complete (the default timeout is 60 seconds)
$job->waitForCompletion(30);

// Download the converted files
$job->downloadTargetFiles('path/to/folder/');

// Delete the source and target files on Zamzar's servers
$job->deleteAllFiles();
```

The above use case might be applied when other things are happening in between each step, but if not, and you want to chain the whole thing together:

```
// Do the whole thing together
$job = $zamzar->jobs->create([
        'source_file' => 'path/to/localfile',
        'target_format' => 'pdf'
    ])
    ->waitForCompletion(120)
    ->downloadTargetFiles('path/to/folder')
    ->deleteAllFiles();
```

Configure a Logger
------------------

[](#configure-a-logger)

The library does minimal logging, if the `debug` config option is used. Use either the supplied default logger or a psr-3 compatible logger.

```
$client = new Zamzar\ZamzarClient([
    'api_key' = '****',
    'debug' => true,
]);

// PSR-3 Compatible Logger
\Zamzar\Zamzar::setLogger($psr3Logger);

// Using Monolog
$logger = new Logger('Zamzar');
$logger->pushHandler(new StreamHandler(__DIR__.'/app.log', Logger::DEBUG));
\Zamzar\Zamzar::setLogger($logger);
```

Resources
---------

[](#resources)

[Code Samples](samples.md) - Copy/Paste from examples which demonstrate all key areas of functionality.

[Exceptions Handling](exceptions.md) - Learn more about API Error Codes.

[Developer Docs](https://developers.zamzar.com/docs) - For more information about API operations, parameters, and responses. Use this if you need additional context on all areas of functionality.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~138 days

Recently: every ~111 days

Total

12

Last Release

333d ago

Major Versions

v1.0.1 → v2.0.02023-06-22

PHP version history (2 changes)v1.0.0PHP &gt;=7.2.5

v2.0.2PHP &gt;=7.2.34

### Community

Maintainers

![](https://www.gravatar.com/avatar/075afd889d6793ab2951546c80f03d8885d53135cf5096cb2bf59167be482c27?d=identicon)[louismrose](/maintainers/louismrose)

![](https://www.gravatar.com/avatar/c088da6003657823486349ad8f2b522aa09de166fb7b3c285df4794b0284e3e7?d=identicon)[zamzar-miked](/maintainers/zamzar-miked)

![](https://www.gravatar.com/avatar/97cf79befff5bf7c2d51ee2ec68668a990b142e45c1949c2fe5df34a1f23e012?d=identicon)[whyleyc](/maintainers/whyleyc)

![](https://www.gravatar.com/avatar/5bf743a06686f0d3be76bc7a8d1c93089c53abd377f5869dd9babac6fce5c5c9?d=identicon)[zamzar-api-sdks](/maintainers/zamzar-api-sdks)

---

Top Contributors

[![Nawv](https://avatars.githubusercontent.com/u/9863676?v=4)](https://github.com/Nawv "Nawv (28 commits)")[![louismrose](https://avatars.githubusercontent.com/u/77096?v=4)](https://github.com/louismrose "louismrose (18 commits)")[![zamzar-miked](https://avatars.githubusercontent.com/u/79094268?v=4)](https://github.com/zamzar-miked "zamzar-miked (12 commits)")[![whyleyc](https://avatars.githubusercontent.com/u/1568556?v=4)](https://github.com/whyleyc "whyleyc (4 commits)")

---

Tags

apizamzarfile conversion

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zamzar-zamzar-php/health.svg)

```
[![Health](https://phpackages.com/badges/zamzar-zamzar-php/health.svg)](https://phpackages.com/packages/zamzar-zamzar-php)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3751.2M45](/packages/tencentcloud-tencentcloud-sdk-php)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.7k371.6k5](/packages/theodo-group-llphant)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[files.com/files-php-sdk

Files.com PHP SDK

2478.1k](/packages/filescom-files-php-sdk)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

563.5M10](/packages/checkout-checkout-sdk-php)[clicksend/clicksend-php

351.6M11](/packages/clicksend-clicksend-php)

PHPackages © 2026

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