robgridley / zebra

PHP ZPL builder, image conversion and a basic client for network-connected Zebra label printers.
MIT License
215 stars 54 forks source link

Blank page after image #3

Open sv1gzf opened 8 years ago

sv1gzf commented 8 years ago

After printing an image label we get a blank page.

we solved the issue with this fix

/* * Compress a row of ASCII hexadecimal data. * @param string $row * @param string $lastRow * @return string */ protected function compress($row, $lastRow) { //if ($row === $lastRow) { // return ':'; //}

    $row = $this->compressTrailingZerosOrOnes($row);
    $row = $this->compressRepeatingCharacters($row);

    return $row;
}
robgridley commented 8 years ago

I can't seem to reproduce that. The line you commented out simply returns a colon if the current row matches the last row (and omits the current row). The total number of rows (height of the image) should be the same.

Can you supply a sample?

sv1gzf commented 8 years ago

I'm using this code $client = new Client('192.168.4.204'); $zpl = new Builder(); $zpl->fo(0,0)->gf(new Image(file_get_contents('voucher.gif')))->fs(); $client->send($zpl); $zpl = new Builder(); $zpl->fo(0,0)->gf(new Image(file_get_contents('receipt.gif')))->fs(); $client->send($zpl);

OR

$client = new Client('192.168.4.204'); $zpl = new Builder(); $zpl->fo(0,0)->gf(new Image(file_get_contents('voucher.gif')))->fs(); $zpl->fo(0,0)->gf(new Image(file_get_contents('receipt.gif')))->fs(); $client->send($zpl);

Attached you can find the labels

voucher receipt

sv1gzf commented 8 years ago

When I un-comment these lines //if ($row === $lastRow) { // return ':'; //}

I get an extra blank page after the first label.

sv1gzf commented 8 years ago

Any luck with this ?