bytes/docraptor
Composer 安装命令:
composer require bytes/docraptor
包简介
DocRaptor API client
关键字:
README 文档
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); }
统计信息
- 总下载量: 31.72k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-06-22