bytes / docraptor
DocRaptor API client
Installs: 30 990
Dependents: 2
Suggesters: 0
Security: 0
Stars: 6
Watchers: 2
Forks: 4
Open Issues: 3
Requires
- php: >=5.3.2
- guzzle/guzzle: ~3.1
Requires (Dev)
- mockery/mockery: dev-master@dev
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2024-11-09 16:53:16 UTC
README
A simple client for the DocRaptor API, written in PHP5.
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:
{ "require": { "bytes/docraptor": "dev-master@dev" } }
Usage
<?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); }