1. Go to this page and download the library: Download smart-dato/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/ */
smart-dato / labelary example snippets
use SmartDato\Labelary\Services\BarcodeType;
use SmartDato\Labelary\Services\Labelary;
$png = Labelary::convertToPng($zpl);
$pdf = Labelary::convertToPdf($zpl);
$barcode = Labelary::generateBarcode('12345678', BarcodeType::CODE128);
Labelary::getInstance()
->setRotation(LabelaryRotation::DEGREES_90) // images and ZPL transformation
->setQuality(LabelaryQuality::BITONAL) // PNG only
->setPageSize(LabelaryPageSize::A4) // the remaining page options are PDF only
->setPageOrientation(LabelaryPageOrientation::LANDSCAPE)
->setPageLayout('2x3') // <columns>x<rows>
->setPageAlign(LabelaryPageAlign::CENTER)
->setPageVerticalAlign(LabelaryPageAlign::TOP)
->setLabelBorder(LabelaryBorder::SOLID)
->setFormatter(true) // ZPL transformation only
->setTargetDpmm(LabelaryDensity::dpmm12); // ZPL transformation only