ZPL II printer: convert image into hex string on linux
===

We are using a ZPL II printer on an ubuntu system.

The php shell_exec() command enables us to send raw data from the local web server to the ZPL II printer (CITIZEN CL-S631). It works fine for the text.

But we have a logo as well. Therefore we need to send it as hex data to the printer. We couldn't find anything beside the ZEBRA tool for converting image files into the needed ZPL II hex code. ZEBRA is offering this tool for Windows only.

Can anyone point us to a possible ubuntu solution for converting images to the needed .GRF format (shown below)?:

    ~DGR:IMAGE.GRF,320,8,
    0000FF300FFF0000
    0005FFF00FFF5000
    001FFFFFFFFFF100
    ...
    ~SD20