Last active
October 23, 2018 10:31
-
-
Save jonathanmaron/6d8a22faba3c2d1d9f6d4dde032faa87 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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