Skip to content

martijndwars/docraptor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP DocRapter API

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);
}

About

PHP5 Docraptor API client

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages