ipp.rs icon indicating copy to clipboard operation
ipp.rs copied to clipboard

How to send raw data?

Open olekhov opened this issue 3 years ago • 1 comments

Hello, I need to send raw data to printer. I am using thermal transfer Zebra printer to print stickers. Each sticker is encoded, like this:

.

N
q300
Q200,24
S1 ; speed
D2 ; density
A10,20,0,3,1,1,N,"-----------------"
A10,40,0,3,1,1,N,""
A10,60,0,3,1,1,N,"TEST 172.30.40.64"
A10,80,0,3,1,1,N,""
A10,120,0,3,1,1,N,"----------------"
P1
.

Problem is, this data is sent to printer as text, whereis it should be sent as raw. As result, stickers look like this: image

These are commands for EPL language, described here

I can print as raw with command like this:

$ cat label.txt | lpr -PZebra_Technologies_ZTC_GK420t -oraw

olekhov avatar Dec 20 '21 15:12 olekhov

Have you tried specifying the document-type to something like application/octet-stream? That should instruct the printer to interpret the data as raw / detect the format itself. Something like this should make it work:

let mut builder = IppOperationBuilder::print_job(uri, payload)
        .attribute(IppAttribute::new("document-format", IppValue::MimeMediaType(String::from("application/octet-stream"))))

ARogovskyy avatar Feb 09 '23 20:02 ARogovskyy