Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get encoded image without ^XA and ^XZ #21

Open
icyz opened this issue Aug 3, 2019 · 1 comment
Open

get encoded image without ^XA and ^XZ #21

icyz opened this issue Aug 3, 2019 · 1 comment

Comments

@icyz
Copy link

icyz commented Aug 3, 2019

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

@bsprengelmeijer
Copy link

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()}";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants