2017 © Pedro Peláez
 

library docraptor

DocRaptor API client

image

bytes/docraptor

DocRaptor API client

  • Wednesday, March 22, 2017
  • by MartijnDwars
  • Repository
  • 1 Watchers
  • 6 Stars
  • 12,399 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 1 Versions
  • 8 % Grown

The README.md

PHP DocRapter API

A simple client for the DocRaptor API, written in PHP5., (*1)

Features

  • Convert HTML to PDF and HTML to Excel through the DocRaptor API.

Requirements

  • PHP >= 5.3.2 with cURL extension

Installation

Using composer, add the following to composer.json:, (*2)

{
    "require": {
        "bytes/docraptor": "dev-master@dev"
    }
}
````

## Usage

```php
<?php

use Bytes\Docraptor\Document\PdfDocument;
use Bytes\Docraptor\Http\Client as HttpClient;
use Bytes\Docraptor\Client;

$document = new PdfDocument('<Document name>');
$html = '<some html goes here>';
$document->setContent($html);

$httpClient = new HttpClient();
$client = new Client($httpClient, 'YOUR_API_KEY_HERE');

try {
    $pdf = $client->setTestMode(true)->convert($document);
    // write to file, stream to user, etc.
} catch (DocraptorException $e) {
        echo($e);
}

The Versions

22/03 2017

dev-master

9999999-dev http://github.com/MartijnDwars/Docraptor

DocRaptor API client

  Sources   Download

MIT

The Requires

 

The Development Requires

by Martijn Dwars

api docraptor