@@ -42,7 +42,7 @@ You can of course also manually edit your composer.json file
4242
4343> Some TSPL2-like printers, such as Atol BP41/Rongta RP410, do not support all TSPL2 features.
4444
45- ##### Read data from printer
45+ #### Read data from printer
4646
4747``` php
4848use PhpAidc\LabelPrinter\Printer;
@@ -51,17 +51,19 @@ use PhpAidc\LabelPrinter\Connector\NetworkConnector;
5151$printer = new Printer(new NetworkConnector('192.168.x.x'));
5252
5353\var_dump($printer->ask('? VERSION$(0)'));
54+
5455// "Direct Protocol 10.15.017559 \r\n"
5556```
5657
57- ##### Create and print label
58+ #### Create and print label
5859``` php
5960use PhpAidc\LabelPrinter\Enum\Unit;
6061use PhpAidc\LabelPrinter\Enum\Anchor;
6162use PhpAidc\LabelPrinter\Enum\Charset;
6263use PhpAidc\LabelPrinter\Printer;
6364use PhpAidc\LabelPrinter\Label\Label;
6465use PhpAidc\LabelPrinter\Label\Element;
66+ use PhpAidc\LabelPrinter\CompilerFactory;
6567use PhpAidc\LabelPrinter\Connector\NetworkConnector;
6668
6769$label = Label::create(Unit::MM(), 43, 25)
@@ -70,10 +72,10 @@ $label = Label::create(Unit::MM(), 43, 25)
7072 ->add(Element::barcode(10, 10, '123456', 'CODE93')->height(60))
7173;
7274
73- (new Printer(new NetworkConnector('192.168.x.x')))->print($label);
75+ (new Printer(new NetworkConnector('192.168.x.x'), CompilerFactory::tspl() ))->print($label);
7476```
7577
76- ##### Add elements only for a specific language
78+ #### Add elements only for a specific language
7779``` php
7880use PhpAidc\LabelPrinter\Label\Label;
7981use PhpAidc\LabelPrinter\Label\Element;
@@ -90,7 +92,7 @@ $label = Label::create()
9092;
9193```
9294
93- ##### Add elements if some value is truthy
95+ #### Add elements if some value is truthy
9496``` php
9597use PhpAidc\LabelPrinter\Label\Label;
9698use PhpAidc\LabelPrinter\Label\Element;
@@ -105,7 +107,7 @@ $label = Label::create()
105107;
106108```
107109
108- ##### Print images
110+ #### Print images
109111``` php
110112use PhpAidc\LabelPrinter\Label\Label;
111113use PhpAidc\LabelPrinter\Label\Element;
@@ -130,7 +132,7 @@ $label = Label::create()
130132;
131133```
132134
133- ##### Print text with emulation
135+ #### Print text with emulation
134136``` php
135137use PhpAidc\LabelPrinter\Label\Label;
136138use PhpAidc\LabelPrinter\Label\Element;
@@ -142,7 +144,7 @@ $label = Label::create()
142144```
143145Text will be drawn with Imagick and printed as bitmap.
144146
145- ##### Specify the number of copies
147+ #### Specify the number of copies
146148``` php
147149use PhpAidc\LabelPrinter\Label\Label;
148150use PhpAidc\LabelPrinter\Label\Element;
@@ -153,20 +155,21 @@ $label = Label::create()
153155;
154156```
155157
156- ##### Batch printing
158+ #### Batch printing
157159``` php
158160use PhpAidc\LabelPrinter\Printer;
159161use PhpAidc\LabelPrinter\Label\Batch;
160162use PhpAidc\LabelPrinter\Label\Label;
161163use PhpAidc\LabelPrinter\Label\Element;
164+ use PhpAidc\LabelPrinter\CompilerFactory;
162165use PhpAidc\LabelPrinter\Connector\NetworkConnector;
163166
164167$batch = (new Batch())
165168 ->add(Label::create()->add(Element::textLine(168, 95, 'Hello!', 'Univers', 8)))
166169 ->add(Label::create()->add(Element::textLine(168, 95, 'Bye!', 'Univers', 8)))
167170;
168171
169- (new Printer(new NetworkConnector('192.168.x.x')))->print($label);
172+ (new Printer(new NetworkConnector('192.168.x.x'), CompilerFactory::fingerprint() ))->print($label);
170173```
171174
172175## License
0 commit comments