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

ActiveApplication[API Development](/categories/api)

knyga/convertapi-php
====================

PHP library for the convertapi.com REST API.

01332PHP

Since Sep 17Pushed 10y ago1 watchersCompare

[ Source](https://github.com/knyga/convertapi-php)[ Packagist](https://packagist.org/packages/knyga/convertapi-php)[ RSS](/packages/knyga-convertapi-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

convertapi-php
==============

[](#convertapi-php)

PHP library for the [convertapi.com](http://www.convertapi.com) REST API.

ConvertApi is an online file conversion service for creating PDF and Images from various source files, such as Word documents, web pages and raw HTML. converapi-php provides a set of classes for using the ConvertApi service with PHP.

Development of this library is not in any way connected with Baltsoft Software.

Installation via [Composer](http://getcomposer.org/)
----------------------------------------------------

[](#installation-via-composer)

- Install Composer to your project root:

    ```
    curl -sS https://getcomposer.org/installer | php
    ```
- Add a `composer.json` file to your project:

    ```
    {
        "require": {
            "knyga/convertapi-php": "dev-master"
        }
    }
    ```
- Run the Composer installer:

    ```
    php composer.phar install
    ```

Using
-----

[](#using)

Using the library is simple:

1. Include the required concrete class ( include('Text2PDF.php'); )
2. Instantiate the class ( $text2pdf = new ConvertAPI\\Text2Pdf(); )
3. Either:
4. Carry out the conversion using filesystem path for output ( $text2pdf-&gt;convert('/path/to/intput/file.txt', '/path/to/output/file.pdf'); )
5. Carry out the conversion using function return for output ( $text2pdf-&gt;convert('/path/to/intput/file.txt'); )

The conversion will write the converted document to the given filesystem path and return verious details about the conversion (depending on the response from ConvertApi), or return a binary string representation of the document.

See example/example.php for a working example.

Extending
---------

[](#extending)

The library currently supports all the conversions available via convertapi.com.

Addition of new conversions is simply a matter of extending the abstract ConvertAPI class and

a) defining:

- $\_apiUrl - the URL of the ConvertApi endpoint (see  for details)
- $\_validInputFormats - an array of document types (extensions) which can be converted

b) completing function \_\_set() to handle additional valid parameters for the conversion being defined.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.2% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/2018b1cb1cfeba7430637ce78f33b8cdc4ed43df995f0000fd16a967897c596a?d=identicon)[knyga](/maintainers/knyga)

---

Top Contributors

[![confuzzledduck](https://avatars.githubusercontent.com/u/893730?v=4)](https://github.com/confuzzledduck "confuzzledduck (56 commits)")[![knyga](https://avatars.githubusercontent.com/u/3603431?v=4)](https://github.com/knyga "knyga (11 commits)")[![Amsterdamys](https://avatars.githubusercontent.com/u/3232259?v=4)](https://github.com/Amsterdamys "Amsterdamys (1 commits)")[![wbarcovsky](https://avatars.githubusercontent.com/u/5498761?v=4)](https://github.com/wbarcovsky "wbarcovsky (1 commits)")

### Embed Badge

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

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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