zebra
zebra copied to clipboard
get encoded image without ^XA and ^XZ
How can I get only ZPL code without ^XA and ^XZ ?
Actually I can trim out those tags, but there is any elegant solution? I've inspected the code but didn't see anything for that.
Thanks
One way to do this is with a workaround:
$decoder = GdDecoder::fromPath($imagePath);
$image = new Image($decoder);
$bytesPerRow = $image->width();
$byteCount = $bytesPerRow * $image->height();
$zplImage = "^GFA,$byteCount,$byteCount,$bytesPerRow,{$image->toAscii()}";