Last active
October 23, 2018 10:32
-
-
Save jonathanmaron/ce2b5769e2ab00fc76e4efb8dd1fdb34 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(), | |
]); | |
$templateName = 'sample_invoice.tx'; | |
$arrayOfBinaryData = $reportingCloud->getTemplateThumbnails('sample_invoice.tx', 100, 1, 1, 'PNG'); | |
foreach ($arrayOfBinaryData as $index => $binaryData) { | |
$destinationFile = sprintf('sample_invoice_p%d.png', $index); | |
$destinationFilename = sys_get_temp_dir() . DIRECTORY_SEPARATOR . $destinationFile; | |
file_put_contents($destinationFilename, $binaryData); | |
var_dump("{$templateName} was written to {$destinationFilename}"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment