diff --git a/README.md b/README.md index 50fe014..9d711bb 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,33 @@ $label = Label::create() ``` Text will be drawn with Imagick and printed as bitmap. +##### Specify the number of copies +```php +use PhpAidc\LabelPrinter\Label\Label; +use PhpAidc\LabelPrinter\Label\Element; + +$label = Label::create() + ->add(Element::textLine(168, 95, 'Hello!', 'Univers', 8)) + ->copies(3) +; +``` + +##### Batch printing +```php +use PhpAidc\LabelPrinter\Printer; +use PhpAidc\LabelPrinter\Label\Batch; +use PhpAidc\LabelPrinter\Label\Label; +use PhpAidc\LabelPrinter\Label\Element; +use PhpAidc\LabelPrinter\Connector\NetworkConnector; + +$batch = (new Batch()) + ->add(Label::create()->add(Element::textLine(168, 95, 'Hello!', 'Univers', 8))) + ->add(Label::create()->add(Element::textLine(168, 95, 'Bye!', 'Univers', 8))) +; + +(new Printer(new NetworkConnector('192.168.x.x')))->print($label); +``` + ## License The PhpAidc LabelPrinter is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT). diff --git a/src/Contract/Label.php b/src/Contract/Label.php index 671b415..8121ea3 100644 --- a/src/Contract/Label.php +++ b/src/Contract/Label.php @@ -21,6 +21,8 @@ interface Label extends Job { public function charset(Charset $value); + public function copies(int $copies); + public function direction(Direction $value); public function add(Command $command); @@ -29,5 +31,7 @@ public function getMedia(): array; public function getCharset(): ?Charset; + public function getCopies(): int; + public function getCommands(string $language): iterable; }