Closed sv1gzf closed 8 years ago
Hi I'm trying to print two labels but It only prints the first one !!!!
I used this simple code
use Zebra\Client; use Zebra\Zpl\Image; use Zebra\Zpl\Builder;
$client = new Client('192.168.4.204');
$image = new Image(file_get_contents('voucher.gif'));
$zpl = new Builder(); $zpl->fo(0, 0); $zpl->gf($image); $zpl->fs();
$image = new Image(file_get_contents('receipt.gif'));
$zpl2 = new Builder(); $zpl2->fo(0, 0); $zpl2->gf($image); $zpl2->fs();
$client->send($zpl2); $client->send($zpl);
If I print the labels one by one it works fine
You're using the same variable name for both images.
You could do this instead:
$zpl->gf(new Image(file_get_contents('receipt.gif')));
Hi I'm trying to print two labels but It only prints the first one !!!!
I used this simple code
use Zebra\Client; use Zebra\Zpl\Image; use Zebra\Zpl\Builder;
$client = new Client('192.168.4.204');
$image = new Image(file_get_contents('voucher.gif'));
$zpl = new Builder(); $zpl->fo(0, 0); $zpl->gf($image); $zpl->fs();
$image = new Image(file_get_contents('receipt.gif'));
$zpl2 = new Builder(); $zpl2->fo(0, 0); $zpl2->gf($image); $zpl2->fs();
$client->send($zpl2); $client->send($zpl);
If I print the labels one by one it works fine