Skip to content

Bad values passed to ^GF Graphic Field causing prints to fail #19

@shanecranor

Description

@shanecranor

Description

Here is a file generated by zebrafy that demonstrates the issue.
Online ZPL readers have no issue parsing it, however when I send it over the network to a printer the printer rejects it.

I set the DPI to 10 to make the example more legible, but it still occurs at high dpi

^XA
^FO0,0^GFA,200,100,5,2a0000000e404000000e151548800e00000000005084092012260000000800208000102488000002db6b6db7502000000008aaad6ad5a225400000080000000000000000001200000000080000000000000000001200007842082a947eaad000007aaa40^FS
^XZ

The parameters for the GF command are
a (compression type): A
b (binary byte count): 200
c (graphic field count): 100
d (bytes per row): 5
data: 100 bytes of data

The issue is that the data is 100 bytes, but the printer is expecting 200 bytes (because the second parameter is set to 200)

labelary appears to ignore the number of bytes and render the zpl regardless, but printers IRL do not.

This ZPLII spec confirms it. https://www.servopack.de/support/zebra/ZPLII-Prog.pdf

Image

For ASCII download, the parameter should match parameter c

Therefore parameters B and C should only differ if compression is being used

I'm currently working on a PR that fixes this issue.

Python version

Python 3.12.9

Zebrafy version

zebrafy==1.2.0

Steps to reproduce

Generate an ASCII zpl from a PDF and look at the output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions