PHPackages                             isset/alfredo - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. isset/alfredo

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

isset/alfredo
=============

Alfredo for PHP 5.3

1.1.2(12y ago)166PHPPHP &gt;=5.3.0

Since Dec 10Pushed 12y ago6 watchersCompare

[ Source](https://github.com/Isset/alfredo)[ Packagist](https://packagist.org/packages/isset/alfredo)[ RSS](/packages/isset-alfredo/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (6)Used By (0)

Requirements
============

[](#requirements)

To take advantage of Online PDF Converter's API you'll need to install the client in your project and have access to our system. There are two keys need to access the API, a:

- Consumer key
- Private key

Without these you won't be able to connect to our servers. Next is the client. This installation process will be explained in the next chapter.

Installation
============

[](#installation)

At the moment the client library is not publicly available. Please contact us to obtain access to this library. The client library needs to be installed through Composer. Click here if you've never used Composer. ()

Add the following to your composer.json file in the "require" section:

```
    "isset/alfredo": "1.*"
```

After you've added the requirement go to your terminal of choice and run the command: If you've installed Composer on your machine:

```
    composer update
```

Otherwise:

```
    php composer.phar update
```

Online PDF Converter's API will now be installed and added to Composer's autoloader.

Create Payload
==============

[](#create-payload)

The conversion of a PDF is done through a payload, which is send to the server. With our API it's possible to create a pdf from several different sources. Currently the available sources: HTML, Pdf and Url. These examples will show you how this it's done:

Attach A Source
---------------

[](#attach-a-source)

### Attach HTML

[](#attach-html)

```
    $payload = new Alfredo\Payload\Pdf\Convert;
    $payload->addhtml('test');
```

### Attach Pdf

[](#attach-pdf)

```
    $payload = new Alfredo\Payload\Pdf\Convert;
    $pdf = file_get_contents('path/to/pdf/file.pdf');
    $payload->addPdf($pdf);
```

### Attach Url

[](#attach-url)

```
    $payload = new Alfredo\Payload\Pdf\Convert;
    $payload->addUrl('http://online-pdfconverter.nl');
```

- Note: Currently our Url conversion is unstable. This is due to the fact that some web pages are not formatted correctly.

Set Callback Url
----------------

[](#set-callback-url)

A callback url is only needed when [working with queues](#queue-payload). This url will be called with response of the conversion. It'll contain two items, named:

- Identifier
- Response

With the identifier it's possible to download the when it's converted. Here's an example of how to set the callback:

```
    $payload = new Alfredo\Payload\Pdf\Convert;
    $payload->setCallback('http://example.com/callback_url');
```

Method chaining
---------------

[](#method-chaining)

All the above methods could be chained together:

```
    $payload = new Alfredo\Payload\Pdf\Convert;
    $payload->addhtml('test')
            ->addPdf(file_get_contents('path/to/pdf/file.pdf'))
            ->addUrl('http://online-pdfconverter.nl');
            ->setCallback('http://example.com/callback-response');
```

Change Converter Type
---------------------

[](#change-converter-type)

Our API is able to switch converter type which each payload. Available types:

- wkhtmltopdf
- htmltopdfjava (Default)

This is how you can change the type:

```
    $payload = new Alfredo\Payload\Pdf\Convert;
    $payload->setConverter('wkhtmltoppdf');
```

Stream Payload
==============

[](#stream-payload)

There are multiple ways to execute conversion. Streaming is one of them. When streaming you'll immediately get a response, but can't be stored by the server, only by the user. For this conversion you'll be needing the consumer and private key. Here is how you can stream a Pdf:

```
    $payload = new Alfredo\Payload\Pdf\Convert;
    $payload->addhtml('test');
    $server = new Alfredo\Server('http://converter.isset.nl', 'consumer_key', 'private_key');

    try {
        $response = $server->stream($payload);
        header('Content-type: application/pdf');
        echo $response
    } catch (Alfredo\ConversionUnableException $e) {
        echo $e->getMessage();
    }
```

Queue Payload
=============

[](#queue-payload)

To queue a pdf conversion you'll need to set a callback url on the payload, this is explained a couple of chapters back. After adding one or multiple sources and a callback url we'll pass the payload to our API.

```
    $payload = new Alfredo\Payload\Pdf\Convert;
    $payload->addhtml('test');
    $payload->setCallback('http://example.com/callback_url');

    $server = new Alfredo\Server('http://converter.isset.nl', 'consumer_key', 'private_key');

    $response = $server->queue($payload);
```

The server will return a JSON string which contains an identifier and the response status. It could be helpful to save the identifier somewhere in a database. When the pdf has converted our server will send a POST request to the callback url with the same JSON string. If the response status states the converion is completed you'll be able to request the pdf like this:

```
    $server = new Alfredo\Server('http://converter.isset.nl', 'consumer_key', 'private_key');

    $payload = new Alfredo\Payload\Pdf\QueueItem;
    $payload->setIdentifier('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');

    $pdf = $server->getQueueItem($payload);
```

The response from the method getQueueItem() will be the converted pdf. You could stream it like explained in the chapter above this one.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 90% 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 ~100 days

Total

4

Last Release

4603d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4cc2496b3830171f38ba41453bc043026aa9f7a9ef1e6a44a93ec22e0c09c793?d=identicon)[IssetBV](/maintainers/IssetBV)

---

Top Contributors

[![fhjbalfoort](https://avatars.githubusercontent.com/u/1055903?v=4)](https://github.com/fhjbalfoort "fhjbalfoort (18 commits)")[![frankdejonge](https://avatars.githubusercontent.com/u/534693?v=4)](https://github.com/frankdejonge "frankdejonge (1 commits)")[![mitchellvanw](https://avatars.githubusercontent.com/u/3061428?v=4)](https://github.com/mitchellvanw "mitchellvanw (1 commits)")

### Embed Badge

![Health badge](/badges/isset-alfredo/health.svg)

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

PHPackages © 2026

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