REST API wrapper for pdfgeneratorapi.com
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

REST API wrapper for pdfgeneratorapi.com

REST API wrapper for PDF Generator API.

Install

Require this package with composer using the following command:

composer require actualreports/pdfgeneratorapi-php

Usage

$client = new \ActualReports\PDFGeneratorAPI\Client($key, $secret);
$client->setWorkspace('unique@workspace.com');
$data = [
    "DocNumber" => "12312", 
    "TotalAmt" => 1231.12
];
$content = $client->output(21650, $data);
header('Content-type: '.$content->meta->{'content-type'});
header('Cache-Control: private, must-revalidate, post-check=0, pre-check=0, max-age=1');
header('Pragma: public');
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Content-Disposition: inline; filename="'.$content->meta->name.'"');
die(base64_decode($content->response));