PHP code example of printu / labelary
1. Go to this page and download the library: Download printu/labelary library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
printu / labelary example snippets
use GuzzleHttp\Exception\GuzzleException;
\Client();
$zpl = '^xa^cfa,50^fo100,100^fdHello World^fs^xz';
try {
$response = $labelary->printers->labels([
'zpl' => $zpl,
'response' => 'application/pdf',
'rotate' => 180
]);
} catch (GuzzleException $e) {
throw new Exception("API Labelary error: ".$e->getMessage());
}