Skip to content

Instantly share code, notes, and snippets.

@jonathanmaron
Last active October 23, 2018 10:31
Show Gist options
  • Save jonathanmaron/6d8a22faba3c2d1d9f6d4dde032faa87 to your computer and use it in GitHub Desktop.
Save jonathanmaron/6d8a22faba3c2d1d9f6d4dde032faa87 to your computer and use it in GitHub Desktop.
<?php
use TxTextControl\ReportingCloud\ReportingCloud;
$reportingCloud = new ReportingCloud([
'api_key' => Helper::apiKey(),
]);
$sourceFilename = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'sample_invoice.tx';
$destinationFilename = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'sample_invoice.pdf';
$binaryData = $reportingCloud->convertDocument($sourceFilename, 'PDF');
file_put_contents($destinationFilename, $binaryData);
var_dump("Written converted document to {$destinationFilename}");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment