PHP code example of wendrowycz / stickie
1. Go to this page and download the library: Download wendrowycz/stickie 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/ */
wendrowycz / stickie example snippets
use FashionValet\Stickie\Builder;
use FashionValet\Stickie\CommandPipe;
$command = (new Builder(new CommandPipe))
->resetMemory()
->setLabelWidth(50)
->setLabelHeight(30)
->setDensity(10)
->copies(1)
->labelStart()
->text(10, 15, 5, 1, 1, 0, 0, 'Item: Brina Flowy Chiffon Skirt - UK 6')
->text(10, 15, 30, 1, 1, 0, 0, 'Brand: Aere')
->text(10, 15, 90, 1, 1, 0, 0, 'SKU: 1504051610-UK 6')
->text(10, 15, 120, 1, 1, 0, 0, 'Price: RM 1,000.00')
->barcode('CODE128', 72, 160, 2, 10, 30, 0, 3, 'AR0009287')
->labelEnd()
->compose();
use FashionValet\Stickie\Printer;
use FashionValet\Stickie\Builder;
use FashionValet\Stickie\CommandPipe;
use FashionValet\Stickie\Driver\LinuxConnector;
$command = (new Builder(new CommandPipe))
->resetMemory()
->setLabelWidth(50)
->setLabelHeight(30)
->setDensity(10)
->copies(1)
->labelStart()
->text(10, 15, 5, 1, 1, 0, 0, 'Item: Brina Flowy Chiffon Skirt - UK 6')
->text(10, 15, 30, 1, 1, 0, 0, 'Brand: Aere')
->text(10, 15, 90, 1, 1, 0, 0, 'SKU: 1504051610-UK 6')
->text(10, 15, 120, 1, 1, 0, 0, 'Price: RM 1,000.00')
->barcode('CODE128', 72, 160, 2, 10, 30, 0, 3, 'AR0009287')
->labelEnd();
$connector = new LinuxConnector('/dev/usb/lp0');
$printer = new Printer($connector, $command);
$printer->generate();