ipp.rs
ipp.rs copied to clipboard
How to send raw data?
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:
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
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"))))